Re: chop off non-meaningful digits

Поиск
Список
Период
Сортировка
От Berend Tober
Тема Re: chop off non-meaningful digits
Дата
Msg-id 4559C304.1030905@seaworthysys.com
обсуждение исходный текст
Ответ на Re: chop off non-meaningful digits  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Ответы Re: chop off non-meaningful digits  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
Список pgsql-general
A. Kretschmer wrote:
> am  Tue, dem 14.11.2006, um  0:58:56 -0500 mailte Tom Lane folgendes:
>
>> "SunWuKung" <Balazs.Klein@t-online.hu> writes:
>>
>>> Yep, I think this is it:
>>> select trim(trailing '0.' from 1.020)
>>>
>> Um, I think not:
>>
>> regression=# select trim(trailing '0.' from 1000.000);
>>  rtrim
>> -------
>>  1
>> (1 row)
>>
> For this case:
>
> test=*> select trim(trailing '.' from trim(trailing '0' from 1000.000));
>  rtrim
> -------
>  1000
>

Perhaps the OP doesn't really care about this, but FWIW one thing I
recall from high school science (or maybe it was middle school), the
zeros to the right of the decimal place ARE meaningful, i.e., 1000.000
signifies something different than 1000, namely, a measurement three
orders of magnitude more precise.  So "chopping off non-meaningful
digits" is something you ought to do only for zeros on the left.


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: gcj requirement for jdbc driver
Следующее
От: "Rob Owen"
Дата:
Сообщение: Re: Out of memory (Failed on request size 24)