Scientific Notation
Is it possible to display numbers in scientific notation? e.g. 1.234567e+6
Thanks.
2 replies
-
not yet, no :-(
Birger
-
I think I've got this worked out, but if you try it and find errors let me know. The number field can't have any formatting for the formula to work. The field name I used is "Number" and it converted to text and assigned to "myNum". Here is the formula that would be entered into a formula field...
let myNum := text(Number);let isNeg := 0;if substr(myNum, 0, 1) = "-" thenisNeg := 1end;if number(myNum) = 0 then"0e0"elseif not contains(myNum, ".") thenlet exp := length(myNum) - 1 - isNeg;if exp >= 1 thensubstr(myNum, 0, 1 + isNeg) + "." + substr(myNum, 1 + isNeg, length(myNum) - length(extractx(myNum, "0*$")) - 1) + "e" + expelsesubstr(myNum, 0) + "e" + expendelseif abs(number(myNum)) < 1 thenlet exp := length(extractx(myNum, "^-?0.0*"));if isNeg then "-" end + substr(myNum, exp, 1) + "." + substr(myNum, exp + 1) + "e-" + (exp - 1 - isNeg)elselet exp := text(index(myNum, ".") - 1 - isNeg);substr(myNum, 0, 1 + isNeg) + "." + substr(myNum, 1 + isNeg, index(myNum, ".") - 1 - isNeg) + substr(myNum, index(myNum, ".") + 1) + "e" + expendendend
Content aside
- 5 yrs agoLast active
- 2Replies
- 1034Views
