Welcome to the nuBuilder Forums!

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

Afterbrowse Lookup NuNumber value incorrect

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
88tc88
Posts: 14
Joined: Tue Mar 04, 2025 10:53 am
Has thanked: 10 times

Afterbrowse Lookup NuNumber value incorrect

Unread post by 88tc88 »

Hi all,

Currently I am having strugles with formatting my NuNumbers in the correct monetary format.

I have a Lookup object in a subform that uses an after browse PHP code to automatically fill the other object in the same subform row.
However, when performing the following after browse code, the value is shown 100x as high.

Code: Select all

$lu = nuLookupRecord();
nuSetFormValue('offerteitem_stukprijs', $lu->artikel_standaardprijs);
The artikel_standaardprijs is the standard price of an article. This artikel_standaardprijs is in the database stored as an decimal(10,2). This value needs to be filled in as the offerteitem_stukprijs, with a nunumber format of '€ 1.000,00'.

What now happens is the following. For instance, the artikel_standaardprijs is '19.00' in the database. When I perform the lookup, the offerteitem_stukprijs shows '€ 1.900,00' instead of '€ 19,00'. With all the other object in my nubuilder environment it handles the differences in . and , correctly.

Thanks in advance for your help
kev1n
nuBuilder Team
Posts: 4342
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 450 times
Contact:

Re: Afterbrowse Lookup NuNumber value incorrect

Unread post by kev1n »

Hi,

Is it possible to show a screenshot?
88tc88
Posts: 14
Joined: Tue Mar 04, 2025 10:53 am
Has thanked: 10 times

Re: Afterbrowse Lookup NuNumber value incorrect

Unread post by 88tc88 »

kev1n wrote: Fri Jun 27, 2025 7:40 pm Hi,

Is it possible to show a screenshot?
Sure!
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4342
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 450 times
Contact:

Re: Afterbrowse Lookup NuNumber value incorrect

Unread post by kev1n »

Since 'artikel_standaardprijs' uses a comma instead of a dot as the decimal separator, we need to convert it before setting the value.

Code: Select all

$lu = nuLookupRecord();

$standaardprijs = str_replace('.', ',', $lu->artikel_standaardprijs);

nuSetFormValue('offerteitem_stukprijs', $standaardprijs);
Post Reply