BrT

Musings about technology and other neat stuff

BrT random header image

WILTAC #5: zero is a special case

December 9th, 2008 · No Comments

Zero is a special case for NSNumberFormatter

I spent a few minutes today trying to figure out why, when setting a value to zero in an NSTableView, the number formatter I had associated with that column (to add a percentage sign to each number) was not being applied. Eventually, I realized that zero is a special case for NSNumberFormatter, and by default the percentage sign was not there. Adding it solved the mystery.

Tags: · · ·