browse_total_rows
Posted: Wed Apr 29, 2020 9:06 pm
I have a strange output in 1 column(SUM), with the same formats in other columns (input=Number).
Uploaded a new one, sorry I have not yet mastered the forumkev1n wrote:The image is not displayed. Can you upload it again?
Code: Select all
window.nuFORM.getCurrent().browse_columns[2].format
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
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);
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);
Did everything by reference, but the sum = 3226.2, although it should be 3226.3
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")
Code: Select all
(3226.29).toFixed(1);