Forum Discussion
QuickBaseCoachD
7 years agoQrew Captain
Here is a shot at a complete formula. But it will still have the problem that the decimals will not line up.
var text PriceToUse = Case([Price List to Use],
"US List Price", [US List Price],
"Asia Dist Price", [Asia Dist Price],
"Asia List Price", [Asia List Price],
"EUR Dist Price", [EU Dist Price],
"EUR List Price", [EU List Price]);
var number Value = Round($PriceToUse ,0.01);
var text Decimals = "." & Right(ToText(Int($Value * 100)),2);
var text Thousands = If($Value>=1000,ToText(Int($Value/1000)));
var text Hundreds=Right(ToText(Int($Value)),3);
var text Words =
"$" & List(",",$Thousands,$Hundreds) & $Decimals;
Case([Price List to Use],
"US List Price", "$" & $Words,
"Asia Dist Price", "$" & $Words,
"Asia List Price", "$" & $Words,
"EUR Dist Price", [Euro Symbol] & $Words,
"EUR List Price", [Euro Symbol] & $Words)
But maybe there is something we can add to right justify this once you get this part working.
var text PriceToUse = Case([Price List to Use],
"US List Price", [US List Price],
"Asia Dist Price", [Asia Dist Price],
"Asia List Price", [Asia List Price],
"EUR Dist Price", [EU Dist Price],
"EUR List Price", [EU List Price]);
var number Value = Round($PriceToUse ,0.01);
var text Decimals = "." & Right(ToText(Int($Value * 100)),2);
var text Thousands = If($Value>=1000,ToText(Int($Value/1000)));
var text Hundreds=Right(ToText(Int($Value)),3);
var text Words =
"$" & List(",",$Thousands,$Hundreds) & $Decimals;
Case([Price List to Use],
"US List Price", "$" & $Words,
"Asia Dist Price", "$" & $Words,
"Asia List Price", "$" & $Words,
"EUR Dist Price", [Euro Symbol] & $Words,
"EUR List Price", [Euro Symbol] & $Words)
But maybe there is something we can add to right justify this once you get this part working.