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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -