0

I have a numeric column that I'm trying to format like currency, but I can't seem to get the format right. I currently have:

to_char(my_column, 'fml9999999999999999999D9999999999999999999')

but it outputs

$.2

If I remove the 'fm' modifier, it outputs:

$                    .2000000000000000000

How would I go about getting it to preserve at least 1 digit on the left, and at least 2 digits on the right while removing all the rest of the trailing 0's?

frodo2975
  • 10,340
  • 3
  • 34
  • 41

1 Answers1

0

Figured it out: the trick is to use 0's where you want it to preserve the digits:

to_char(my_column, 'fm9999999999999990D00')
frodo2975
  • 10,340
  • 3
  • 34
  • 41