Oracle 10g Float Format

How can I return from a float / decimal value with the following:

SELECT 210 
  FROM DUAL

... receive:

210.00 

... instead 210?

Using pl / sql oracle 10g

+3
source share
3 answers
SELECT TO_CHAR(210, '999.99') FROM dual;

Additional to_char formats are here .

+3
source

Using:

SELECT CAST(210 AS NUMBER(3,2))
  FROM DUAL

... to get the value as a numeric data type. TO_CHARwill work with the filter, but returns the result as a string.

Link:

+2
source

to_char, , . to_char (210.00, '000.00') . Google " ", .

Edit Find "Number Format Elements" here .

+1
source

Source: https://habr.com/ru/post/1729783/


All Articles