views:

29

answers:

1

I have used NSNUmberFormatter in a cell of NSTableView. This NSNUmberFormatter is dragged from the IB library and put in the table view cell. Then from the inspector constraints are modified. However during run of the aplication when I enter some values which has trailing zeros e.g. 9.100, the cell displays only 9.1. How do I retain the trailing zeros as well?

A: 

Put the desired number of zeros after the decimal in the number formatter's format. As mentioned in the docs, this class uses the Unicode number formatting patterns.

Joshua Nozzi
Thanks for the link. But my problem is not fixed yet. I have set the min and max fraction digits allowed as 0-4. But when I enter 9.100, i need to retain the two trailing 0. But instead the display is 9.1
Subrat
Have you tried reading the NSNumberFormatter documentation? The min/max have nothing to do with format. Set the behavior to "Mac OS X 10.4+ Custom" and - behold! - format fields are exposed.
Joshua Nozzi