Page 1 of 1

Need MC code snipit: Hide/Delete 1000/100 place in price

Posted: Jun 20 2024
by Sky
Example: price is posting at 5126.25

I'm looking to display just the 10's, 1's and decimal place of the price; so just the "26.25".

Been thinking about how to get this done, but alas............... just smoke from the brain belt.

Just looking for a snipit of code to apply in my setup.
Thanks for any help and much appreciated.

Re: Need MC code snipit: Hide/Delete 1000/100 place in price

Posted: Jun 21 2024
by OZ Trade

Code: Select all

print(rightstr(numtostr(close,2),5));
Once you 'numtostr' you can extract with 'rightstr'

Re: Need MC code snipit: Hide/Delete 1000/100 place in price

Posted: Jun 21 2024
by TJ
Try this:

Code: Select all

FracPortion( Close/100 ) * 100 ;

Re: Need MC code snipit: Hide/Delete 1000/100 place in price  [SOLVED]

Posted: Jul 01 2024
by Sky
OZ and TJ............thanks for the most eloquent snippet and solution. My brain was working on a long-winded solution, but lucky for me, I was patient.

TJ, happy to hear you're still on the rock. Stay strong and best of luck.