The value saved in the database is 0.0 as numeric data type, I need to retrieve 0.00 with the select. is there a way in postgres?
Question posted in PostgreSQL
The official documentation can be found here.
The official documentation can be found here.
2
Answers
See here for documentation.
Formatting a value for being rendered in a specific way in the frontend is not a concern of the database.
Instead, use
String#%
to control how the float should be formatted in the frontend. In your case, when you want to render the float with two digits, you can use this formatting rule: