Greetings Team
I’m looking for any help on drawing numbers. The first part is drawing a whole number and the second is how to limit decimal places?
defparam drawonlastbaronly=true
If Year<>Year[1] then
yearlyClose = close[1]
yearlyHigh = Highest[BarIndex - lastYearBarIndex](High)[1]
yearlyLow = Lowest[BarIndex - lastYearBarIndex](Low)[1]
lastYearBarIndex = BarIndex
endif
drawtext("_PH #yearlyHigh#",barindex,yearlyhigh) coloured(204,0,204)
drawtext("_PC #yearlyClose#",barindex,yearlyclose) coloured(204,0,204)
drawtext("_PH #yearlyLow#",barindex,yearlylow) coloured(204,0,204)
return
My question is; how is it possible to print the price to either a whole number with NO decimal places, OR to say within 2 decimal places e.g. 12,161.00
I know in excel for example it’s possible to format cells to display information as XXX.XXX
Is this possible in PRC? If so, how?
Thank you for help in advance 🙂
The ProRealCode documentation is your friend!
ROUND
CEIL
FLOOR
@Vonasi Thank you… I must have missed those in the repository! But they’re just perfect. I’ll get working to put them to good use.