Sunday, February 19, 2012

format a numeric values with commas

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.

>--Original Message--
>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
>hari wrote:
>.
>
..
See my answer to your other question about removing zeros.
SK
hari wrote:

>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.
>
>.
>
>
|||thanks Steve,
it's working fine for removing zeroes and formating it
with commas. i changed it with combining ur previous and
current answers.
rgds,
hari.
[vbcol=seagreen]
>--Original Message--
>See my answer to your other question about removing zeros.
>SK
>hari wrote:
so.[vbcol=seagreen]
there
>.
>

No comments:

Post a Comment