Forum Discussion
KenFirchKenFirc
11 years agoQrew Trainee
Too bad the new ToFormattedText function is weak and can't handle this basic situation! Maybe there are more parameters to the ToFormattedText function we don't know about. Probably not the most efficient, and there's got to be a better way. Not sure how it will work under various regional settings, but....
var number v = Case(Trim([Client - Address: Country2]),
"United Kingdom", [CC Proposed - GBP],
"United States", [CC Proposed - USD],
"France", [CC Proposed - EUR],
[CC Proposed - GBP]);
var text currencysymbol = Case(Trim([Client - Address: Country2]),
"United Kingdom", "� ",
"United States", "$ ",
"France", "� ",
"� ");
var text posnegsign = If($v < 0,"-","");
var text inttext = ToText(Abs(Int($v)));
var text fractext = ToText(Abs(Round(Frac($v),0.01)));
var number fractextlength = Length(ToText(Abs(Round(Frac($v),0.01))));
$currencysymbol & $posnegsign & $inttext & Case($fractextlength,
1, ".00",
3, Mid($fractext,2,2) & "0",
4, Mid($fractext,2,3))
var number v = Case(Trim([Client - Address: Country2]),
"United Kingdom", [CC Proposed - GBP],
"United States", [CC Proposed - USD],
"France", [CC Proposed - EUR],
[CC Proposed - GBP]);
var text currencysymbol = Case(Trim([Client - Address: Country2]),
"United Kingdom", "� ",
"United States", "$ ",
"France", "� ",
"� ");
var text posnegsign = If($v < 0,"-","");
var text inttext = ToText(Abs(Int($v)));
var text fractext = ToText(Abs(Round(Frac($v),0.01)));
var number fractextlength = Length(ToText(Abs(Round(Frac($v),0.01))));
$currencysymbol & $posnegsign & $inttext & Case($fractextlength,
1, ".00",
3, Mid($fractext,2,2) & "0",
4, Mid($fractext,2,3))