corstro
November 30, 2023, 9:41am
1
Hello,
we have problem with rounding numbers after upgrading to new version of Forms app (currently on 3.2.8). Sharepoint field is configured to have 2 decimal places (worked fine on old forms version) and also precision on forms app is configured to 1.00. But after entering number with decimal places, form rounds number to integer. We are using Slovak locale on Sharepoint site. Do you have any advice how to solve this issue?
Thank you,
bnunweiler
(Bryn Nunweiler)
November 30, 2023, 8:46pm
2
I have the same issue. Added another field to a form, saved it and then a currency field started rounding.
Margo
(Margo)
December 1, 2023, 7:23am
3
Hello @bnunweiler , @corstro ,
I couldn't reproduce the same behavior on my form.
Is it a Number or Currency field type? Please share the screenshot of the field settings including the SharePoint field and General sections like so:
Does number fields on all forms behaves this way? Do you have any custom code on the form that changes this field widget? Example:
fd.field('Field1').widgetOptions = {
format: 'n2'
}
Please check the app package version used by that specific form. Go to page source >> page >> forms.plumsail.com and share the screenshot:
bnunweiler
(Bryn Nunweiler)
December 1, 2023, 6:43pm
4
No custom code btw. Checking the package now. Should be the latest version.
bnunweiler
(Bryn Nunweiler)
December 1, 2023, 9:23pm
6
Webpart/1.0.8.0
widget/1.0.8
Is there an update?
Hi Nikitina,
here is the screenshot from designer:
We tried to remove whole javascript and it behaves still same on all number fields.
We are using same version of ap package as bnunweiler:
Updating app package from the Sharepoint store (link ) to the latest version solved that issue. But firstly I had to remove old version from the app catalog manually.
1 Like
Margo
(Margo)
December 4, 2023, 6:52am
9
@bnunweiler ,
Please update the app package to the latest version.
For this, delete an existing app package from the App Catalog and install the latest one from the Microsoft AppSource .
Then, re-save the form, clear the browser cache and test if the issue is resolved.
bnunweiler
(Bryn Nunweiler)
December 6, 2023, 10:40pm
10
Updated and Fixed. Thank you.
1 Like
cwalter2
(Chad)
December 8, 2023, 1:23pm
11
I am having the issue with a currency field.
No custom format in JS.
App package version I am getting this:
It is also storing the numbers rounded.
Margo
(Margo)
December 11, 2023, 6:22am
12
Hello @cwalter2 ,
Please share the screenshot of the SharePoint field settings like so:
And please record a short video demonstrating the field behavior. I will try to reproduce that on my form.
cwalter2
(Chad)
December 11, 2023, 2:43pm
13
Here is the field settings:
I pass the rate from the parent form, in the video shown it is $72.96. I verify the numbers are coming in correctly in console:
So for (1) ST Hour, I should get $72.96. It is rounding to $73 and storing the numbers this way.
It is important to note, this form used to work properly. I wanted to make a change to the new form and that is when the issue presented itself. If I used the edit form on older items, the numbers are stored and calculating correctly.
Margo
(Margo)
December 12, 2023, 9:08am
14
@cwalter2 ,
How do you pass the value from parent to child? Please share the code.
Please also export child form and share it with me. I will check the field settings and test it on my side.
cwalter2
(Chad)
December 12, 2023, 1:41pm
15
I pass the numbers using a custom new button from the parent form:
var newCatBtn = {
text: 'Add Category',
class: 'btn-primary',
visible: false,
icon: 'Add',
iconType: 0,
click: function() {
var url = 'https://mysite.sharepoint.com/sites/pwa/SitePages/PlumsailForms/Project%20Categories/Item/NewForm.aspx?FormID=fc1058b5-a908-46a0-8b2b-822930f5f6f0';
Dialog.open(url, {
passedId: fd.itemId,
passedSingleLineText7: PhaseOrigNumber,
passedSingleLineText9: PhaseCopy,
passedSingleLineText8: PhaseNumber,
passedSingleLineText6: PhaseId,
passedNumber10: fd.field('CompSTCost').value,
passedNumber11: fd.field('CompOTCost').value,
passedNumber12: fd.field('CompDTCost').value
}, function(hasSaved, returnedArgs) {
if (hasSaved) {
fd.control('CategoryList').refresh();
calcBudget();
} else {
console.log("Form Didn't Save")
}
}, {width: Number(window.innerWidth) * .75, height: Number(window.innerHeight) * .85, title: fd.field('Project_x0020_Number').value + ' - ' + fd.field('Title').value + ' | New Category for ' + PhaseNumber + ' - ' + PhaseCopy});
}
};
The fields CompSTCost, etc. is a common field that is populating on render via a lookup. These numbers do come in correctly and are passed as numbers.
Here is the form:
Item (New) Project Categories.customization (20.9 KB)
Margo
(Margo)
December 13, 2023, 11:59am
16
@cwalter2 ,
Thank you! What version of the desktop designer are you using? Please share the screenshot.
What is your site's locale?
If you open this New form from the SharePoint list view, not from the parent form, and set field value with the code from the browser console, do you see the same behavior?
fd.field('STRate').value = 75.84
cwalter2
(Chad)
December 13, 2023, 12:34pm
17
Desktop Designer:
Locale:
I do see the same behavior if opening from list view.
Margo
(Margo)
December 14, 2023, 10:30am
18
@cwalter2 ,
I couldn't reproduce the issue. The field value has two decimals:
Please share the version number of the designer. For this click on the designer icon at the top left of the screen >> About:
If your version is not 3.3.0, please update the designer and re-save the form.
cwalter2
(Chad)
December 15, 2023, 4:17pm
19
I deleted the fields from the form and put them back in I get the decimals now however I only get (2) if there is a number in the hundredths location. I.e., $95.50 appears as $95.5. I also am not getting the dollar sign.
Here is the designer:
Margo
(Margo)
December 18, 2023, 11:36am
20
@cwalter2 ,
This is as designed. You can change the currency field formatting with the code:
fd.field('Currency').widgetOptions = {
format: 'c2'
}
cwalter2
(Chad)
December 19, 2023, 9:29pm
21
Perfect. I made that change and all is working.
1 Like