Sample Header Ad - 728x90

PostgreSQL and MONEY data type for currency values

11 votes
1 answer
29272 views
For a project, I created a table with a column price MONEY NOT NULL column. And I thought it would handle decimals properly, unlike a floating number (i.e. IEEE rounding issues), but I end up having values like $9.94 (string) being returned from the database, instead of 9.94 (numeric). Having to manually manipulate the field value by removing the dollar sign is silly; is there a way to have a MONEY column without a currency sign? If not, what's the best data type replacement to handle currency values?
Asked by Yanick Rochon (1651 rep)
Jan 15, 2015, 06:29 PM
Last activity: Jan 15, 2015, 06:31 PM