Re: Latex formatting

Поиск
Список
Период
Сортировка
От Peter Wintoft
Тема Re: Latex formatting
Дата
Msg-id B9093982-ECE8-485C-82BF-FE128C01E7B9@lund.irf.se
обсуждение исходный текст
Ответ на Re: Latex formatting  (Andrej <andrej.groups@gmail.com>)
Список pgsql-novice
Ok, thanks. Not fluent enough in C to be able to help. But I wrote a function that basically does the job, although
someextra 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\\cdot10\^{\\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 <peter@lund.irf.se> wrote:
>> What language is used for patches?
>
> C
>
>>
>> / Peter
> Cheers,
> Andrej



В списке pgsql-novice по дате отправления:

Предыдущее
От: Andrej
Дата:
Сообщение: Re: Latex formatting
Следующее
От: Gary Warner
Дата:
Сообщение: "Voting" question?