I'm showing tools. How to use it is a decision of each developer. If you get cents from API and you want to show them, there's nothing bad about this extension.

For example, Stripe, the most popular payment processor, uses cents in JavaScript and NSNumber in Objective-C and Swift (which as you say is a bad practice, because Double can be placed in NSNumber container). Node.js can pass cents as API response and here you'll get use case for this extension.

It's just a tool, it can be used right and wrong, for good and for bad.

Written by

Game and software developer with more than 15 years experience. Founder and CEO at Mariposa Studios, freelancer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store