I managed to figure it out.
2 sliders one called value which generates the number with this in the source
seedRandom(index, true)
random(0,100)
and another slider with the code
places = effect("Number of Decimals")("Slider");
val = effect("Value")("Slider"); //sub in the name of your slider here
factor = Math.pow(0.1, places) ;
sign = "";
if (val < 0) sign = "-";
val = Math.abs(val);
whole = Math.floor(val);
fraction = "" + Math.round((val - whole)/factor)*factor;
for (fraction; fraction.length < places+2; fraction+="0");
sign + whole + "." + fraction.substring(2, places+2)