When you have some numbers that you need to show in your user interface, you shouldn’t just stick them in a string using whatever old library function you happen to have. Especially
printf in C,
toString in Java, and others like these are only suitable for debugging, because they have no idea about how to format numbers properly according to the user’s regional settings. The ways to write numbers have differences across languages and countries, especially with the characters used to separate the whole part and the decimal part, and also with regard to how large numbers are grouped to make them easier to read. Luckily you don’t have to figure out the details yourself.
Instead of traditional programmer-style functions, use the convenient API methods provided by your platform. They do all the heavy lifting and work out the details for you. For example, in iOS you use
NSNumberFormatter class from the Foundation framework. Since iOS 4.0 it has offered a very nice way to get a locale-specific representation of a number so that it honors the current user settings.
NSNumberFormatter has a class method called
localizedStringFromNumber:numberStyle:, so you can use it without even creating an instance of the class.
Many of you know already that we make a little app called Les Nombres for iPhone and Windows Phone to help you learn French numbers. It was originally created in late 2010 for the iPhone, to help the author who was learning French for the first time. The realization that an algorithmic approach would work in generating textual representations of numbers in French led to a simple but delightful iPhone application. Since its initial publication in the App Store as a free, ad-supported app it has been downloaded a few thousand times.
With version 1.2 the name of the application was changed to a more suitable “Les Nombres”, with the numbers being read by a native French speaker. This update sparked most of those people who had originally downloaded the app to update it to the latest version. Starting with version 1.3 the app costs US $ .99 (0.79 €)—and stay tuned for a nice little update later this year. (EDIT: the update is now available)
We thought it would be interesting to take a closer look at where the app was being downloaded from. The iTunes Connect report data from between late April and mid-July 2012 was used as the basis of this chart (select it to view full-size).
Les Nombres for iPhone Downloads By Country
Just a quick service announcement: all systems are running smoothly now, after a period of administrative shuffling.
In February this year Conifer Productions transformed from a sole proprietorship into the Finnish equivalent of a limited liability company (LLC), or the “osakeyhtiö” (Oy). Technically this is not quite a transformation, because according to the Finnish business law the sole proprietorship must be dissolved and a new company established. The trade registry will contain a note about the new company continuing the business of the sole proprietorship, but the two are separate legal entities, with different Finnish business IDs, taxation, bookkeeping etc.
We are happy to announce that Les Nombres for iPhone is again available in the App Store!
Version 1.3 of the application now costs US $0.99 (EUR 0.79 or equivalent), but it works the same as the previous version. So, if you already have version 1.2, there is no need to buy this version now. However, if you do buy it now, you will get a free update to the next major release of the application.
In other news, Binary Response Unit (B.R.U.) for iOS has been retired. We sincerely thank this little unit for the services rendered, but these were not the droids we were looking for.