question

Julio R avatar image
0 Likes"
Julio R asked Jordan Johnson commented

Decimal point on Slide statistics

Hello,

Is there a way to change the decimals shown in a Slide that uses statistics? I just want to show two decimal and sometimes none

1640113592407.png

FlexSim 22.0.0
slidestat format
1640113592407.png (56.8 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Jordan Johnson commented

You'll probably want to specify precision in string.fromNum():

double x = 4.794368421053;
return string.fromNum(x, Math.frac(x) ? 2 : 0);

This code checks for a fractional part of the number. If present, it uses 2 as the precision. If not, it uses 0.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Julio R avatar image Julio R commented ·

Thanks @Jordan Johnson ,


There is no other way than to change it directly in the code right?

1640118535320.png


0 Likes 0 ·
1640118535320.png (7.7 KiB)
Jordan Johnson avatar image Jordan Johnson ♦♦ Julio R commented ·
I think so. I don't know another way to do it.
0 Likes 0 ·