| От | Alban Hertroys |
|---|---|
| Тема | Re: evaluating equation stored in a string |
| Дата | |
| Msg-id | 444F9A59.6000108@magproductions.nl обсуждение |
| Ответ на | evaluating equation stored in a string ("SunWuKung" <Balazs.Klein@t-online.hu>) |
| Список | pgsql-general |
SunWuKung wrote:
> However I have a problem with this cast. I don't know how to handle
> brackets in the equation, since
>
> SELECT 35/124 ::numeric
> --0.28....
>
> while
>
> SELECT (35/124) ::numeric
> -- 0
The brackets aren't your problem, your numbers aren't as accurate as the
result you require. An eval() function would give the same results.
You'll want this instead:
SQL> select (35.0/124.0)::numeric;
numeric
------------------------
0.28225806451612903226
Regards,
--
Alban Hertroys
alban@magproductions.nl
magproductions b.v.
T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede
// Integrate Your World //
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера