Fmt vs DecimalToDecimal/DecimalToString
Posted: Thu May 14, 2009 7:01 pm
I have a Decimal(11,2) that I want to add to a Sequential file in a Varchar field. For instance, I want to see "Total: 9999.99" in the Sequential file.
I'm finding that it's not always showing the 2 decimal places.
So I went searching for a way to force it to always show 2. I've seen discussions on DecimalToDecimal and DecimalToString, but I didn't get anywhere with those.
I finally stumbled upon Fmt(number, 'R2') which seems to be doing the trick. This seems so easy, so I'm wondering why this hasn't been in any of the posts I've seen here regarding showing the decimals. Is there something wrong with this?
I'm finding that it's not always showing the 2 decimal places.
So I went searching for a way to force it to always show 2. I've seen discussions on DecimalToDecimal and DecimalToString, but I didn't get anywhere with those.
I finally stumbled upon Fmt(number, 'R2') which seems to be doing the trick. This seems so easy, so I'm wondering why this hasn't been in any of the posts I've seen here regarding showing the decimals. Is there something wrong with this?