How do I define the 'Number format' as 'Fraction Number' in a number field?
How do I define the 'Number format' as 'Fraction Number' in a number field?
5 replies
-
I don't think that's possible with a number field. You'd have to concatenate the fraction to the whole number in a formula field.
-
In my previous post I assumed you wanted to use ¼ instead of .25
-
Sean, thank you, I'm afraid I'm not that skilled yet though!…
-
…Yes you assumed correctly, that's precisely what I pretend to do.
-
geral, if you want a starting point this might help. This code goes into a formula field...
let myNum := format(Number, "#,###.##0");
let decLoc := index(myNum, ".") + 1;
let myDecimal := substr(myNum, decLoc, 3);
let myFrac := "";
switch myDecimal do
case "125":
(myFrac := "⅛")
case "25":
(myFrac := "¼")
case "375":
(myFrac := "⅜")
end;
myNum := format(Number, "#,###");
myNum + " " + myFrac
You can add more case statements to test for more decimals. "Number" is just the name of the number field I use in this example. Here are a couple of links you can check out...
https://www.alt-codes.net/fraction-symbols - For the fractions
https://ninoxdb.de/en/manual/calculations/reference-of-functions-and-language - For the Ninox language reference
Content aside
- 5 yrs agoLast active
- 5Replies
- 2411Views