sql - Function format number -


for oracle,

can fixes function below let works "a number (10,2)"? condition only.

here come function..

create or replace function fmt_num(n1 in number) return char begin return to_char(n1,'fm9,9999.99'); end; / 

and can use sql statement follow

select fmt_num(price) a; 

that depends on mean "works" , output want. guess want update format mask

to_char( n1, 'fm999,999,999.99' ) 

that assumes, though, want use hard-coded decimal points , separators , want use american/ european convention of separating numbers in sets of 3 rather than, say, traditional indian system of representing large numbers.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

php - Dynamic url re-writing using htaccess -

java - Multi-Label Document Classification -