all groups > sql server mseq > september 2004 >
You're in the

sql server mseq

group:

format a numeric values with commas



format a numeric values with commas hari
9/22/2004 3:03:19 AM
sql server mseq: hi,
I have requirement.
I want to format a numeric value with commas. is there
any function to use in transact-sql query to do this.
for example if the numeric value is 27519.37 then it
should be formatted as 27,519.37
if the numeric value is 1221512.34 then it should be
formatted as 1,221,512.34

regards,
hari.

Re: format a numeric values with commas Steve Kass
9/22/2004 9:54:01 AM
declare @list_price numeric(20,6)
set @list_price = 1221512.34

select
convert(varchar(100),cast(@list_price as money),1)

Steve Kass
Drew University

[quoted text, click to view]
Re: format a numeric values with commas hari
9/23/2004 12:59:51 AM
hi Steve,
Thanks for that. it is working fine.
But for the whole numbers like 123456 it is not doing so.
it is formatting to 1,234,567.00 (with two zeroes after
decimal). i want it to be formatted as 1,234,567

how to format 1234567 to 1,234,567.

thanks,
hari.

[quoted text, click to view]
Re: format a numeric values with commas pranab_das26
11/10/2004 1:23:42 AM

Dear Friend

Do you have the VBA Code which convert a numeric values to spelling i
MS Access/Visual Basic


For exmple

"1234" converts to "one thousand two hundred thirty four Only


-
pranab_das2
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1084920.htm
AddThis Social Bookmark Button