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
  • To use a floating point field, you cannot place text "$" within the value portion - we use the method suggested by sikhivahans above, placing "$" in the field label. If you must place the "$" in the value you will have to use a textField, with something like:

    load(
    local!totalCost: 0,

    a!textField(
    label: "Total Cost",
    labelPosition: "ABOVE",
    value: "$" & if(isnull(local!totalCost),0,fixed(local!totalCost,2)),
    saveInto: a!save(local!totalCost,todecimal(save!value)),
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {}
    )
    )
Reply
  • To use a floating point field, you cannot place text "$" within the value portion - we use the method suggested by sikhivahans above, placing "$" in the field label. If you must place the "$" in the value you will have to use a textField, with something like:

    load(
    local!totalCost: 0,

    a!textField(
    label: "Total Cost",
    labelPosition: "ABOVE",
    value: "$" & if(isnull(local!totalCost),0,fixed(local!totalCost,2)),
    saveInto: a!save(local!totalCost,todecimal(save!value)),
    refreshAfter: "UNFOCUS",
    required: true,
    validations: {}
    )
    )
Children
No Data