views:

198

answers:

1

Hi

Apologies if this is a dumb question but I'm trying to format a currency value for my iphone app and am struggling to left-justify the currency symbol, but right-justify the value. So, "$123.45" is formatted as (say)

$   123.45
depending on format-width. This is a kind of accounting format (I think).

I've tried various methods with NSNumberFormatter but can't get what I need.

Can anyone advise on how to do this?

Thanks

Fitto

+1  A: 

You're looking for the paddingPosition property of NSNumberFormatter. You need to set this to NSNumberFormatterPadAfterPrefix for the desired format.

Can Berk Güder
Brilliant. Worked a treat. Thanks
Fittoburst