Ok, so i have a RGB selector, this RGB selector takes the normal RGB output of whatever a user selects and divides the R, G & B values by 255.00
For example, RED (255,0,0) would be equal to: (1,0,0)
Another example, This normal RGB output (134,14,197) would get converted to this: (0.5254901960784314,0.054901960784313725,0.7725490196078432)
Now how would i take these values and make it so it only shows THREE numbers after the decimal point? So for example the below RGB value (0.5254901960784314,0.054901960784313725,0.7725490196078432) would be equal to this: (0.525,0.054,0.772)
I've tried using the toFixed()
function and the toPrecision()
without any success. Sorry for this question, it's just that i'm kindof a noob and have been researching/trying to find an answer to this for the past few days.
EDIT: Here is an example of what i've tried:
StoreR=R_OUT.value/255.00.toFixed(2);
//NOTE: R_OUT.value is equal to the RED value, for example: 0.5254901960784314