Hi All,
i have floatingpoint field in my UI, i want to restrict user from typing values upto 2 decimal point and Below is my expected results
but what is the issue am facing is its allowing me to enter more values after decimal point and also if i give round values it's not taking .00 value.below is my code
a!floatingPointField( label: "Dental Premium (Annual)", labelPosition: "ABOVE", value: ri!intakePreminumDetails['recordType!{4d82eb7f-ba46-46a2-a7dc-969f4ffcf344}GSE_SCL Intake Premium Details.fields.{cef89c65-a133-4766-bbb5-93cbcceddcab}dentalPremium'], saveInto: { a!save(ri!intakePreminumDetails['recordType!{4d82eb7f-ba46-46a2-a7dc-969f4ffcf344}GSE_SCL Intake Premium Details.fields.{cef89c65-a133-4766-bbb5-93cbcceddcab}dentalPremium'], if(a!isNotNullOrEmpty(save!value),fixed(save!value,2),null)), },
my rule input source is recordtype. and which of data type as decimal and also in db its decimal(10,2) .note(am using external db (sql server management studio) using connected system)
Discussion posts and replies are publicly visible
a!floatingPointField cannot restrict decimal input during typing because it lacks a decimalPlaces parameter and relies on native browser number input behavior.Try this
a!localVariables( local!dentalPremium: null, a!textField( label: "Dental Premium (Annual)", labelPosition: "ABOVE", refreshAfter: "UNFOCUS", value: if( a!isNullOrEmpty(local!dentalPremium), null, text(local!dentalPremium, "0.00") ), saveInto: a!save( local!dentalPremium, if( a!isNullOrEmpty(save!value), null, floor(todecimal(save!value) * 100) / 100 ) ) ) )