Re: Latex formatting
От
Peter Wintoft
Тема
Re: Latex formatting
Дата
Msg-id
B9093982-ECE8-485C-82BF-FE128C01E7B9@lund.irf.se
Ответ на
Re: Latex formatting (Andrej)
Список
Дерево обсуждения
Latex formatting Peter Wintoft <peter@lund.irf.se>
Re: Latex formatting Bruce Momjian <bruce@momjian.us>
Re: Latex formatting Peter Wintoft <peter@lund.irf.se>
Re: Latex formatting Andrej <andrej.groups@gmail.com>
Re: Latex formatting Peter Wintoft <peter@lund.irf.se>
Ok, thanks. Not fluent enough in C to be able to help. But I wrote a function that basically does the job, although some extra parameter could be added to control the formatting:
create function sci (x float) returns text as $$ select regexp_replace(to_char(x,'9.99EEEE'),'(.+)e(-*)(\+*)(0*)(.+)',E'$\\1\\cdot 10\^{\\2\\5}$') $$
Example:
select sci(0.003337),sci(5678);
sci | sci
----------------------+---------------------
$ 3.34\cdot 10^{-3}$ | $ 5.68\cdot 10^{3}$
(1 row)
/ Peter
On 2012-10-18, at 20:55 , Andrej wrote:
> On 19 October 2012 01:38, Peter Wintoft wrote:
>> What language is used for patches?
>
> C
>
>>
>> / Peter
> Cheers,
> Andrej
В списке pgsql-novice по дате отправления