web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Float value not saved ...
Power Pages
Unanswered

Float value not saved properly in table column

(0) ShareShare
ReportReport
Posted on by 118

Hello,

 

I have a web form in which I have an input field that masks the user input to a certain format ("#.##0,00"). To do this, I had to hide the original input field and create a new one:

 

//hide base field
 $(baseImponible).hide();

 //create new masked base
 let maskedBase = document.createElement("input");
 maskedBase.className = "form-control";
 maskedBase.id = "maskedBase";
 //add function to base to set its mask and to calculate the total using the field "iva"
 maskedBase.oninput = () => {
 console.log("Mascara de Base Imponible");
 let newValue = parseFloat($("#maskedBase").val().replace(/\D/g, '')) / 100;
 $(baseImponible).val(newValue.toFixed(2));
 console.log("Base imponible: ", $(baseImponible).val());
 let calculatedValue = (1 + parseFloat($(iva).val().replace(/\D/g, '')) / 100) * newValue;
 calculatedValue = calculatedValue.toFixed(2);
 $(importeTotal).val(calculatedValue);
 console.log("Importe total: ", calculatedValue);
 console.log($(importeTotal).val());
 }

 //apply mask to base 
 $(maskedBase).mask(decimalFormat, {reverse: true});
 //insert masked base
 $(maskedBase).insertAfter($(baseImponible));

 


baseImponible is the table column, as you can see:

let baseImponible = "#cr027_baseimponiblenumber";

 

Everything logs properly, as it should. However, when I checked the value that's stored in the database I saw the decimals were ignored and added two empty decimals. The column value type is Float.

 

Actual behaviour:

User inputs 100.000,02

System stores 10.000.002,00

 

Expected behaviour:

User inputs 100.000,02

System stores 100.000,02

 

How can I fix this? How can I save the value I want into the corresponding column?

 

Thanks in advance!

Categories:
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    You don't need to re-create the control just for adding mask

    Please take a look at this post: http://oliverrodrigues365.com/2020/04/15/power-apps-portals-adding-field-mask/

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 25 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 20

#3
DianePana Profile Picture

DianePana 9

Last 30 days Overall leaderboard