Re: Formatting a set of NSDecimalNumber values
Re: Formatting a set of NSDecimalNumber values
- Subject: Re: Formatting a set of NSDecimalNumber values
- From: Kyle Sluder <email@hidden>
- Date: Fri, 10 Aug 2012 10:46:04 -0700
On Aug 10, 2012, at 9:29 AM, Jens Alfke <email@hidden> wrote:
>
> That doesn't seem like a workaround, it seems like the correct solution (although why not use the user's real locale?). Fundamentally you are trying to display and align character strings, so you have to treat the numbers as strings when computing their alignment. For best results use AppKit (or UIKit?) methods to compute the pixel width of each string in the font you're using.
Don't forget bout languages where numbers read right-to-left.
A better solution might be to use a decimal-aligned tabstop in the NSParagraphStyle of all of the currency cells' attributedStringValues. But that might require taking ownership of the entire text system and doing rendering yourself.
O, to be able to assign an NSLayoutManager to an NSTextFieldCell… (radar forthcoming).
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden