Display Number in Dollar() Format

Can someone please tell me the best way to display this decimal number in dollar() format in my SAIL form? Here's my code:

a!floatingPointField(
label: "Total Cost",
labelPosition: "ABOVE",
value: ri!totalCost,
saveInto: ri!totalCost
refreshAfter: "UNFOCUS",
required: true,
validations: {}
)

OriginalPostID-247183

  Discussion posts and replies are publicly visible

Parents
  • @sikhivahans yes I have read that, I tried the below approach but get data type error when the SAIL form loads saying "Expression evaluation error: Could not find variable 'totalCost'"

    a!textField(
    label: "Total Cost",
    labelPosition: "ABOVE",
    value: if(isnull(ri!totalCost), "", dollar(ri!totalCost)),
    saveInto: todecimal(save!ri!totalCost),
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {}
    )
Reply
  • @sikhivahans yes I have read that, I tried the below approach but get data type error when the SAIL form loads saying "Expression evaluation error: Could not find variable 'totalCost'"

    a!textField(
    label: "Total Cost",
    labelPosition: "ABOVE",
    value: if(isnull(ri!totalCost), "", dollar(ri!totalCost)),
    saveInto: todecimal(save!ri!totalCost),
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {}
    )
Children
No Data