Change NSNumberFormatter's negative format from (xxx.xx) to -xxx.xx

前端 未结 4 1962
栀梦
栀梦 2021-01-02 14:25

I want to change my NSNumberformatter from displaying negative numbers with parenthesis around them to putting the minus sign in front (or whatever the localized standard is

4条回答
  •  佛祖请我去吃肉
    2021-01-02 15:05

    OK, so the answer that I got working is:

    [currencyFormatter setNegativeFormat:@"-¤#,##0.00"];
    

    the key is this whatzit? character "¤". No idea what it's called? anyone? but it represents the localized currency in these format strings...

提交回复
热议问题