Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSDecimalNumber instead of Double #2828

Closed
MasterWatcher opened this issue Sep 26, 2017 · 1 comment
Closed

NSDecimalNumber instead of Double #2828

MasterWatcher opened this issue Sep 26, 2017 · 1 comment

Comments

@MasterWatcher
Copy link

Hi,

I use Charts for displaying money data that is stored as NSDecimalNumber. Then I convert it to double and pass to the Charts. For vertical axis I use my own value formatter that convert 1000 to 1.00k 1000,000 to 1.00m etc. And it works with NSDecimalNumber for better accuracy. The problem occurs with big values (around 9 billion). In stringForValue of my custom IChartAxisValueFormatter I got value as 5,999,999,999.999,999 instead of 6,000,000,000. Then it's converted to NSDecimalNumber and I got 5.99b instead of 6.00b.
Is it possible to change axis entries to NSDecimalNumber? Or use something like LargeValueFormatter from MPAndroidChart

@liuxuan30
Copy link
Member

liuxuan30 commented Oct 8, 2017

The axis values are just Double and make perfect sense. It's up to you what to format into. You can try search any available formatter can do the job. But I used to write a simple large value formatter as well ( 10k, 100M, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants