Search Postgresql Archives

Re: to_char(0,'9999.99') -> ".00"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I asked:
>>	to_char(0,'9999.99')
>>
>>returns	.00 rather than 0.00.

Dave Smith replied:
to_char(0,'9990.00')
?


Thanks Dave, that's embarrassingly obvious...

I note that the examples in the documentation don't have a 0 before the decimal point, e.g. this one

to_char(148.5, 'FM999.990')	'148.500'

I imagine that in most cases people do want '0.000' rather than '.000', so perhaps these examples should be changed to, in this case, 990.000.

Regards,

--Phil.


---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux