How to format decimal values as percentages in FusionCharts? - fusioncharts

I'm rendering a FusionCharts line chart that represents a change of percentage value over time.
I'm providing the values of each data point in decimal format (that is 0.01 for 1% and so on).
FusionCharts seems to have rich capabilities for number formatting (see e.g. the docs on number scaling) but I can't seem to figure out how to simply format the decimal values like 0.03 as percentages (3%).

To format decimal values into percentage can be achieved thru Number Scaling. Using "numberScaleValue" and "numberScaleUnit", decimals [0.03] will be converted to 3%
`<chart numberScaleValue='.01' numberScaleUnit='%'..>`

Related

Differences between format long and format long g

I searched differences between format long and format long g in Matlab.But I'm not sure exactly what the differences are between them.Does the difference between them affect accuracy?
Thank you...
The commands format X in Matlab affect the display of text.
So format short will display 4 digits after the decimal point. This is the default display option. The command format long will display more digits after the decimal point. The addition of a G will tell Matlab to additionally display in scientific notation if it is more compact.
There is not difference in terms of computed values or accuracy, just display. From the doc format or here Display Format Matlab article:
format does not affect how MATLAB computations are done. Computations
on float variables, namely single or double, are done in appropriate
floating point precision, no matter how those variables are displayed.
Computations on integer variables are done natively in integer.
format long basically a fixed decimal format. It always show 7 digits after decimal point for single accuracy and 15 digits after decimal point for double accuracy.
format longG are going to show up to 7 digits after decimal point for single accuracy and 15 digits after decimal point for double accuracy. But, if there is a zeros behind, it won't be shown. So, longG is more compact.
It won't affect the accuracy for calculation. Accuracy are depends on single or double precision.
Look at my example below, if I've saved a as 12.999012 and called for pi, MATLAB will response like this :
Format longG
Format long
If you are also asking for the format short and format shortG, the difference just the 4 digits behind decimal point.
Cheers!

Tableau rounds my numbers to 16 decimals on import. How can I stop this?

When connecting to a data source and importing data into Tableau decimals are limited to 16 places. I have large decimals that are being multiplied by millions of products so these rounding errors are affecting my end calculations.
I made sure the data type is coming in as Number (decimal).
I would like the data to be imported into Tableau un-rounded.
Tableau, like Excel, uses floating point precision for its numbering system.
This means that Tableau will only provide 15 digits of precision for numbers.
If this were for display purposes, I would suggest bringing the numbers in as strings. See this similar answer. However, because mathematical operations are being performed, the precision is unavoidable.
If possible:
Perform mathematical operations elsewhere. For example, a custom SQL query that will bring the table to Tableau with operations already complete.
Try to operate in a smaller scale - instead of multiplying by millions, multiply by hundreds/thousands and change the name of the field to represent the scale. (ie: 'thousands of millions' instead of billions.) Something like this perhaps.

display specific number of significant figures rather than decimal places in crystal reports 2008

Good Morning!
I am working in Crystal Reports 2008 & have a report template that I'd like to use with various dynamic parameters (called in a downstream application).
My data can vary from being on a scale of 0-1 to a scale of 1,000-10,000.
I'd like to display it with 3 significant figures so when the report pulls in a dataset that
looks like this --> displays like this
0.76895 --> 0.769
0.6672 --> 0.667
1.0335 --> 1.03
but when the data set
looks like this --> displays like this
12,125.65 --> 12,100
956.35 --> 956
4,352.22 --> 4,350
My current work around is to make two templates-- one to use with my small value data, set to display 3 decimal places; and another to use with my large value data, set to display no decimal places.
I was wondering if there was a way to set significant figures displayed rather than decimal points?
Oh! I would do it in SQL first and pass it in as a string but I need these as numeric values so I can summarize them elsewhere in the report. Thanks.
If you right-click on your numeric field and choose format, Customize..under the number tab you get a bunch of choices to set the decimal separator, how many decimals to display, etc. choosing the formula button next to Decimals, you could put in a formula that looks at the amount of digits after the decimal dot and then either set the decimals to 2 if there are more than 3 decimals, and to zero decimals if there are 2 decimals. They key here is to get the order right. You want to check for the 2 decimals first and then for 3 or more decimals. If you do it the other way around the formula will display everything without decimals.
Hope that helps,
Chris
Use something like this.
ToNumber(Totext(<<DatabaseField>>,0,""))

Eliminating common factor in display of MATLAB matrices

What I am trying to do is probably relatively simple.
As you see, this matrix is being displayed such that all terms are to be multiplied by 1.0e+04. I want to disable this feature and see the numbers as they "really" are.
The format command can fix this for you. From the docs:
FORMAT SHORT Scaled fixed point format with 5 digits.
FORMAT LONG Scaled fixed point format with 15 digits for double
and 7 digits for single.
These are the defaults, and what you want is:
FORMAT SHORTG Best of fixed or floating point format with 5
digits.
FORMAT LONGG Best of fixed or floating point format with 15
digits for double and 7 digits for single.

Matlab MATPOWER Output in long format

I've been trying to use MATPOWER to do a power flow analysis for a network i have but all the outputs are coming with only 2 decimal places. Is there a way to configure the output to have the long format?
Trota,
You can modify the number of decimal places printed on screen or forwarded to the output text file.
If you browse the printpf.m file, simply change the required %9.xf to the required number of decimal places, where x is the number of digits after the decimal point. For bus data, these can be found at line 412 onwards.
Hope this helps.
You cannot change the number of decimal places used in the pretty-printed output of MATPOWER, but all of the results are available in full precision in the results struct returned by runpf() or runopf(). You can display these results with whatever precision you choose using standard Matlab commands such as disp() or fprintf().