Hello everybody.
I am working with a Form that is attached to a SQL connection, which was used to create the fields within the form (so numeric vs. text vs. bit, etc.).
I am trying to figure out a way to setup decimal precision on the input side, because I need the numbers to be transferred to SQL with the correct amount of precision because the data is then being pulled from SQL into PowerBI.
For example, one of my fields is "pH", and is technically a Text Input with the Format property set to TextFormat.Number. I need to set it up so that when the user enters a number (let's say "6"), it automatically adds a precision of one decimal place ("6.0"). Or, if they enter "6.75", it rounds to "6.8".
I have seen numerous ways to do this on the return (in a ViewForm), but none for submitting or editing data via an EditForm.
Thanks and let me know if I can clarify anything!
That makes sense, but I would prefer for just the input box to show what the recorded value would be, instead of having the number appear twice, as I feel that would clog my form up with extras. Here is what my input looks like now:
After the user either clicks off of it, I'd like that to add the precision of one decimal place, or round it if decimals already exist.
I would probably change the DataCardKey from Parent.DisplayName to the
Parent.DisplayName &" will be recorded as "& RoundDown(DataCardValue1.Text, 6)
That would show the user in real time what the value would be. Why wait?
That is a great solution and immensely helpful as it will allow me ensure that the numbers are rounded on transfer, thank you!
Do you (or anyone else) know of a way that I can update the input on screen so (perhaps utilizing the "OnChange" property), so that my users can also see the rounded numbers before they submit the form?
This would be done in the Update property of the data card containing the TextInput box. Where normally it would just say something like DataCardValue1.Text, change it to Round(DataCardValue1.Text,6), for example to round it up or down to 6 decimal places.