• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Formatting a set of NSDecimalNumber values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Formatting a set of NSDecimalNumber values
      • From: Sixten Otto <email@hidden>
References: 
 >Formatting a set of NSDecimalNumber values (From: Sixten Otto <email@hidden>)
 >Re: Formatting a set of NSDecimalNumber values (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: filtering the values in an NSTableColumn
  • Next by Date: Re: Formatting a set of NSDecimalNumber values
  • Previous by thread: Re: Formatting a set of NSDecimalNumber values
  • Next by thread: Re: Formatting a set of NSDecimalNumber values
  • Index(es):
    • Date
    • Thread