Forum Discussion
UrsulaLlaveria
6 years agoQrew Assistant Captain
That is really concerning to me. We use this often when converting numeric to text for Word document generation. If it is rounding the numbers or truncating them, then what is the point of having this as a formula?
------------------------------
Ursula
------------------------------
------------------------------
Ursula
------------------------------
MarkShnier__You
Qrew Legend
6 years agoI have never really got those to fully cooperate for me, so I do it the old way. Here is one of my formulas.
var number Value = Round([currency field],0.01);
var text Decimals = "." & Right(ToText(Int(Abs($value) * 100)),2);
var text Thousands = If(Abs($Value)>=1000,ToText(Int(Abs($Value)/1000)));
var text Hundreds=Right(ToText(Int(Abs($Value))),3);
If($Value=0,"$0.00",
If($Value<0, "<font color=red>- ")
&
"$" & List(",",$Thousands,$Hundreds) & $Decimals)
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
var number Value = Round([currency field],0.01);
var text Decimals = "." & Right(ToText(Int(Abs($value) * 100)),2);
var text Thousands = If(Abs($Value)>=1000,ToText(Int(Abs($Value)/1000)));
var text Hundreds=Right(ToText(Int(Abs($Value))),3);
If($Value=0,"$0.00",
If($Value<0, "<font color=red>- ")
&
"$" & List(",",$Thousands,$Hundreds) & $Decimals)
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- UrsulaLlaveria6 years agoQrew Assistant CaptainThanks mark!
I actually ended up having to do something similar, but included more functionality for the decimal places, since that is where the issue is. The problem is, we shouldn't have to do any of this work, as the toFormattedText field is supposedly doing the formatting for us, not manipulating the data. Clearly, it is, which means that this formula should be removed until it is fixed. One rounded digit can skew data, and I would much rather not use it or even have it as an option if it isn't going to do what it is supposed to. To make sure that the decimals are not rounded, but are displayed exactly as they were input in the numeric field, I do the following:
-- Grab original value / Grab the decimal value
var number OriginalValue = [Reimbursement Cap];
var number theSplit = Frac([Reimbursement Cap]);
--make sure the decimal value has at least two number, if it doesn't, add a 0. This will make sure that someone that just added a .5 displays as .50
var number cents = ToNumber(Left(Right(ToText($theSplit)&"0","."),2));
var text numt = ToText(Floor($OriginalValue));
-- check to make sure that if the user did not add decimals, it still displays .00, adds a 0 before any single digits, and is formatted like so: ($xxx.xx)
var text centsFinal = "($" & ToFormattedText(ToNumber($numt),"comma_dot",3) & "." & If($cents>0 and $cents<10,"0"&ToText($cents),If($cents>=10,ToText($cents),"00")) & ")";
The above function makes sure that no decimal is rounded up, but stays exactly as it was input in the field.
------------------------------
Ursula
------------------------------