Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
browse_total_rows
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
browse_total_rows
I have a strange output in 1 column(SUM), with the same formats in other columns (input=Number).
You do not have the required permissions to view the files attached to this post.
Last edited by kknm on Thu Apr 30, 2020 10:41 am, edited 1 time in total.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: browse_total_rows
Uploaded a new one, sorry I have not yet mastered the forumkev1n wrote:The image is not displayed. Can you upload it again?
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: browse_total_rows
What output do you get when you enter this in the developer console (Press F12 to bring up the browser's Developer Console)
Code: Select all
window.nuFORM.getCurrent().browse_columns[2].format
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: browse_total_rows
in console - ""kev1n wrote:What output do you get when you enter this in the developer console (Press F12 to bring up the browser's Developer Console)
Code: Select all
window.nuFORM.getCurrent().browse_columns[2].format
Even when choosing a format, the sum in the first calculated column is float, in the rest the integer
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: browse_total_rows
Please also run this code in the dev. console and post the output here:
Code: Select all
var c = window.nuFORM.getCurrent().browse_columns;
var x = "";
for (var index = 0; index < c.length; ++index) {
x = x + "\n Column " + index + " : " + c[index].format;
}
alert(x);
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: browse_total_rows
kev1n wrote:Please also run this code in the dev. console and post the output here:
Code: Select all
var c = window.nuFORM.getCurrent().browse_columns; var x = ""; for (var index = 0; index < c.length; ++index) { x = x + "\n Column " + index + " : " + c[index].format; } alert(x);
You do not have the required permissions to view the files attached to this post.
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: browse_total_rows
Did everything by reference, but the sum = 3226.2, although it should be 3226.3
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: browse_total_rows
That's because nuBuilder's addFormatting() does not round correctly from a mathematical point of view. It just trims off the additional decimal places.kknm wrote:Did everything by reference, but the sum = 3226.2, although it should be 3226.3
Code: Select all
nuFORM.addFormatting(3226.29, "N|1000.0")
but
Code: Select all
(3226.29).toFixed(1);
Last edited by kev1n on Thu Apr 30, 2020 4:04 pm, edited 1 time in total.