Guest Basundhara Ghosal

basic question on formatNumber and formatNumberScale

Recommended Posts

Sorry if this is covered somewhere. But so far going thru the docs, good as they are, I have yet to find a basic property reference that can answer this. I have looked in the forums, but still don't seem to find an answer to what seems like a basic question about these two properties:

 

 

 

* is formatNumber boolean (0 = false | 1 = true)? Some of the advanced number formatting examples seem to imply this. It also implies that this property suppresses display of scale separator (e.g., thousand separator) and decimal separator/decimal places.

 

 

 

* is formatNumberScale boolean ( 0 = false | 1 = true)? All the examples I've seen show only these two values and that does seem to be the implication. But it isn't clear. If true, it appears that this property controls whether scaling (truncation) is applied to numbers displayed in the chart.

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Samit,

formatNumber(Boolean ) :-

This configuration determines whether the numbers displayed on the chart will be formatted using commas, e.g., 40,000 if formatNumber='1' and 40000 if formatNumber='0 ' .

formatNumberScale(Boolean ) :-

Configuration whether to add K (thousands) and M (millions) to a number after truncating and rounding it - e.g., if formatNumberScale is set to 1, 1043 would become 1.04K (with decimals set to 2 places). Same with numbers in millions - a M will added at the end. For more details, please see Advanced Number Formatting section.

decimalSeparator :-

This option helps you specify the character to be used as the decimal separator in a number. For more details, please see Advanced Number Formatting section.

thousandSeparator :-

This option helps you specify the character to be used as the thousands separator in a number. For more details, please see Advanced Number Formatting section.

Please note :-

  • FusionCharts automatically formats your numbers by adding K,M (Kilo, Million) and proper commas to the numbers.

  • In case, the data for chart is 12500, 13400 and 13300. FusionCharts automatically formats the number scaling to convert to K (Thousands) & M (Millions). If you do not wish to truncate numbers in this manner, set formatNumberScale='0'

    Ref.- <chart formatNumberScale='0'..>

  • It also add commas to the numbers at the required places. If you do not need the commas too, set formatNumber=0. But, setting formatNumber=0 wouldn't format any decimal places too (even if explicitly specified in XML).

    Ref.- <chart ... formatNumber='0' formatNumberScale='0' ..>

For further details please refer to the links below :-

Ref.- http://www.fusioncharts.com/docs?/Number_Basics.html

  http://www.fusioncharts.com/docs?/Number_Scaling.html

  http://www.fusioncharts.com/docs?/ChartSS/Column2D.html

Hope this helps. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now