Is there a way to set the default format to use when formatting numbers in Flex 3?

70 Views Asked by At

For instance, my application is formatting negative numbers with parenthesis by default. I would like for it to use the negative sign instead but across my entire application and not on a per number formatter basis.

Is there somewhere I can globally set some defaults so I don't have to depend on each NumberFormatter() instance in the entire application?

Thanks.

1

There are 1 best solutions below

0
On

You are getting all the negative numbers formatted by parenthesis instead of minus sign, is becuase of your OS' regional number format settings. By defult Flash picks up formatting information from your OS. So if you change your OS' regional number format settings to show a minus sign for negative numbers, then you will see all numbers formatted with that.

If you want to implement L10N in your project, then you will have to use labelFunction / formatString properties of the columns / text fields and format the numbers to formats selected by user in your project's L10N settings. Flex's Globalization package will be handy for this. Checkout this.