Weird problam with expressions on source text
Came across this problem
I'm trying to animate a text layer, that will go from 0 to 1 (and have at least 0.1, 0.2, 0.3 etc... while going there) via slider, and an expression that uses that slider, and will constantly have the letter "M" by its right side. so it'll be 0M, 0.1M, 0.2M and so on...
I've tried many many expressions, but none of them - NONE OF THEM, will have M by the right side of the number while the number a decimal...
const sliderValue = effect('Slider Control')('Slider');
const isWholeNumber = sliderValue % 1 === 0
const parsedNumber = isWholeNumber ? Math.trunc(sliderValue) : sliderValue;
`${ parsedNumber }M`;
--------------------------------
`${ slider1 }${ +slider2 === 0 ? '' : ('.' + slider2) }M`
--------------------------------
`${ slider1 }${ +slider2 === 0 ? '' : ('.' + slider2) }` + ' M'none of these will work as the M disappears once there's a decimal.
BUT........ for some reason... it DOES WORK - with OTHER letters: like R, Y, Z... but it doesn't work with M. doesn't work with N either...
unfortunately I need it to work with M so I won't have to make a specific layer for M.
Why wouldn't this work? anyone?
Thanks.
