If you have a money element on the parent form that is formatted the way you want the data to be displayed you can use @AsFormattedByLE().
ex:
VSPrice1 = @FormFieldValue ("ORDER", "GLOSS", vSub)
PrintString (@AsFormattedByLE(CurrencyElement, 0, VSPrice1), 1010, vYCor, 0, "Arial", 11,0)
If you do not have a currency element on the parent form, then you can do something like this:
In Global Code:
Function FormatMoney(vVal as Money) as String
Var vBack as String
Var vWhole as String
Var vFrac as String
Var vDub as Double
Var vNeg as Boolean
Var vTSep as Char
Var vDSep as Char
Var vCurSymb as Char
//Modify these 3 lines to change the Thousands Separator, Decimal Separator, and Currency Symbol
vTSep = "."
vDSep = ","
vCurSymb = "$"
vNeg = 0
If vVal < 0 Then
{
vNeg = 1
vVal = @ABS(vVal)
}
vWhole = @Str(@Int(vVal))
vFrac = @Str(@Frac(vVal)) + "00"
While @Len(vWhole) > 3
{
vBack = vTSep + @Right(vWhole, 3) + vBack
vWhole = @Left(vWhole, @Len(vWhole) - 3)
}
vBack = vWhole + vBack
If @Instr(vFrac, ".") > 0 Then
{
vDub = @ToNumber(vFrac)
vFrac = @Str(@Decimals(@Round(vDub, 2), 2))
vFrac = @Right(vFrac, 2)
}
vBack = vCurSymb + vBack + vDSep + @Left(vFrac, 2)
If vNeg = 1 Then
{
vBack = "-" + vBack
}
Return vBack
End Function
and then:
VSPrice1 = @FormFieldValue ("ORDER", "GLOSS", vSub)
PrintString(FormatMoney(VSPrice1), 1010, vYCor, 0, "Arial", 11,0)
-Ray