Adding leading zero
Posted: 05 Apr 2021 01:15
I'm calculating with hex color values for a progress bar.
And the part where i'm converting the individual RGB values doesn't let me have a '0' as a first character.
For example:
080F00 results in 8F0
I'm using this function to convert decimal to hexadecimal:
No matter what i do, it either results into errors, or just doesn't give me the leading '0'.
Doesn't work.
Also doesn't work.
Working with 'numberformat' and regex also lead to nothing.
Does anyone know? This is just silly.
And the part where i'm converting the individual RGB values doesn't let me have a '0' as a first character.
For example:
080F00 results in 8F0
I'm using this function to convert decimal to hexadecimal:
Code: Select all
hex = callJavaStaticMethod("java.lang.Integer", "toHexString(int)", newSubCol);
Code: Select all
concat("0", hex)
Code: Select all
"0" + hex
Working with 'numberformat' and regex also lead to nothing.
Does anyone know? This is just silly.