Pre loader

Text formatting does not work well

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

yAxis.textFormatting = “%f”
First image file is the result of this code.

yAxis.textFormatting = “0.00000000”
Second image file is the result of this code.

First code doesn’t work, even it is just a sample code in document.
Second code works, but I want flexible trailing zeros.
How can I do?

Version
2.2.1.2265
Images
  • You must to post comments
2
0

Hello, Minsub Kim.
Thank you for your interest in SciChart.

In the first case, formatting is not fully correct. And the second case works as expected.
Let me explain, in more details:
‘textFormatting’ property is used by NSNumberFormatter object under the hood, and NSNumberFormatter – accepts format patterns based on Unicode Technical Standard #35.
So ‘0’ symbol in number format string means, that digit will be always displayed (odd zero in case if actual digit is absent). If you want flexible trailing zeros use ‘#’ symbol instead of ‘0’. For example ‘0.0##’ format will convert 2.3345 number to 12.334, and 1.2 number will be displayed as is.

If you want to build more advanced formats – here is a link to Unicode Technical Standard #35 and NSNumberFormatter documentation.

Hope, this information will help.
Best Regards,
Andriy.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies