Re: commas in money field
Posted in 1996
> >Can anyone tell me how I can get commas inserted into the >output of the dollar portion of the money datatype? For >example, if a column is of type money(13,2) and has a >value of 1234567.89, I like the output of that column from >a simple select statement to be $1,234,567.89. > >I have OnLine Dynamic Server 7.12 UC1 running on Solaris 2.4. > >David. > >ps. I've tried setting LC_MONETARY; it does not do what I want. > David, I don't know of a nice, clean way in SQL (there may however be a nasty, dirty way!). If you can use an ACE report, you can use the following: format .... print money_col using "$<<,<<<,<<<.&&" Increase the number of '<' characters (with appropriate commas) as necessary. Without using ACE, I suppose you could pipe the output from a select statement through something like sed or awk. I might have a go if I get time later :-) HTH, Richard.