Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

browse_total_rows

Questions related to customising nuBuilder Forte with JavaScript or PHP.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: browse_total_rows

Unread post by kev1n »

This is probably due to the browser cache. In particular, if the JavaScript function is located in a linked file, the updated file is not loaded, but the one in the cache.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: browse_total_rows

Unread post by kknm »

kev1n wrote:
kknm wrote:I tried this with the original browse_total_rows, but that didn't work.
What do you mean, it didn't work? It works for me just fine. After the change you have to log in again.
All the same, the original script rounds off incorrectly. And sometimes it works correctly, but today I again saw such a picture.
total.PNG
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: browse_total_rows

Unread post by kev1n »

When you refresh the form, are the total figures still shown like that?
When using toFixed(1), no more than 1 decimal number should be shown.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: browse_total_rows

Unread post by kknm »

kev1n wrote:When you refresh the form, are the total figures still shown like that?
When using toFixed(1), no more than 1 decimal number should be shown.
In nuformclass.js write:
var s = Number('0.'+ d).toFixed(F.places).slice(2);
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: browse_total_rows

Unread post by kev1n »

Can you give me the three numbers (33.30, 368.40, 369.40) with all decimal places that sum up to 772.09999999 ?
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: browse_total_rows

Unread post by kknm »

kev1n wrote:Can you give me the three numbers (33.30, 368.40, 369.40) with all decimal places that sum up to 772.09999999 ?
The amount is collected only from those numbers in the table.
err.PNG
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: browse_total_rows

Unread post by kev1n »

Are these numbers rounded up or do they have a higher precision in the db?
33.30...?
368.40...?
369.40...?
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: browse_total_rows

Unread post by kknm »

kev1n wrote:Are these numbers rounded up or do they have a higher precision in the db?
33.30...?
368.40...?
369.40...?
baza.PNG
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: browse_total_rows

Unread post by kev1n »

Ok thanks, so there are also just two decimals in the database and the numbers must be stored as 33.30, 368.40, 369.40 in the table. Right?
I'll try to reproduce the behavior here.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: browse_total_rows

Unread post by kev1n »

Are you sure that there's a format set for the column that shows the total as 772.099999999?

If the format is blank, I get the same output. If I set 1000.00, the correct sum is displayed.
format.png
You do not have the required permissions to view the files attached to this post.
Post Reply