Output value only to 2 decimal places


Category:
0
0

Hi Peter,

Quick question. I want PersonPivot points displayed in a label. If I use this statement, the label prints to 4 decimal places when I only want it to 2 decimal places. How do I change the output from say from 99.1234 to 99.12?

Thanks in advance.

def PP =PersonsPivots(0.02, “day”, 1, 0).pp;
addlabel(yes, ” PP ” + PP,color.MAGENTA);

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on September 26, 2018 3:20 pm
71 views
1
Private answer

Had an RTFM moment.

def PP =PersonsPivots(0.02, “day”, 1, 0).pp;
addlabel(yes, ” PP ” + astext(PP, Numberformat.TWO_DECIMAL_PLACES),color.MAGENTA);

Marked as spam
Posted by (Questions: 1, Answers: 1)
Answered on September 26, 2018 5:58 pm