If the wildcard comes up as 27, it presents as 27, not 27.0. This means the significant figures in the answer are incorrect.
Sue's comment made me take a closer look at the significant figures workaround for the Formulas question. I worked in javascript.
First, Javascript has the toPrecision() method. It adds trailing zeros, for example:
var Number=123.45; Number.toPrecision(6) // returns 123.450
Unfortunately,
var Number=123.45; Number.toPrecision(2) // returns 1.2e+2 instead of 1201.2e+2 is not wrong. It simply is in exponential format, which often would not be as convenient as the decimal format.
I worked out the following javascript for significant figures with trailing zeros and the decimal format maintained:
< script > var x={z}; // x : number to round var s = {nsf}; // s : number of significant figures if (x == 0) { xr = 0; // xr : number to round (= 0) } else { var a = s-1-Math.floor(Math.log10(Math.abs(x))); // Inflate/deflate exponent var b = Math.pow(10,a); // Inflate factor var c = Math.pow(10,-a); // Deflate factor var d = Math.abs(x)*b; // Inflate var e = Math.round(d); // Keep significant digits var f = e*c; // Deflate // Trailing zeros var g = e.toString(); var h = g.length; var z = "0"; if (a==0) {xr=g+".";} // Add "." Ex.: 200 w/ 3 sig fig = 200. if (a<0) {xr=g+z.repeat(-a);} // Trailing zeros if (a>0) { if (a<h) {xr=g.substr(0,h-a)+"."+g.substr(h-a,a);} // No trailing zeros required (x > 0) if (a>=h) {xr="0."+z.repeat(a-s)+g;} // No trailing zeros required (x < 0) } if (x<0) {si="-";} else {si=""} xr=si+xr; // Add minus sign } < /script >
This script seems to work like a charm.