Forum Discussion
QuickBaseCoachD
7 years agoQrew Captain
Try this one. Just change the first line to use your currency field.
var number Value = Round([My 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)
var number Value = Round([My 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)
KeithJusas
7 years agoQrew Captain
Mark, i've used this formula and it retains the decimals and it also extends to millions
var number Value = Round([MY FIELD],0.01);
var text Decimals = "." & Right(ToText(Int($value * 100)),2);
var text Thousands = If(Abs($Value)>=1000,ToText(Int(Abs($Value)/1000)));
var text Hundreds=Right(ToText(Int($Value)),3);
var text Millions = If($Value>=1000000,ToText(Int($Value/1000000)));
If($value>=1000000,"$" & ToFormattedText($value, "comma_dot") & $decimals,
If($Value=0,"$0.00",
If($Value<0, "- ")
&
"$" & List(",",$Millions,$Thousands,$Hundreds) & $Decimals))
var number Value = Round([MY FIELD],0.01);
var text Decimals = "." & Right(ToText(Int($value * 100)),2);
var text Thousands = If(Abs($Value)>=1000,ToText(Int(Abs($Value)/1000)));
var text Hundreds=Right(ToText(Int($Value)),3);
var text Millions = If($Value>=1000000,ToText(Int($Value/1000000)));
If($value>=1000000,"$" & ToFormattedText($value, "comma_dot") & $decimals,
If($Value=0,"$0.00",
If($Value<0, "- ")
&
"$" & List(",",$Millions,$Thousands,$Hundreds) & $Decimals))