How to round quantité in Report

I wouldnt go messing with the database structure you will surely break something. Show us what you tried.

Thx for ur replay but [=F({4},'#')] return nothing see below:

When i change the language to English in Samba Pos it resolve the problem and all quantity in reports became normal.

Any one have any idea how to show quantity in french localisation without 3 decimal ?

If thats the case its reiogonal settings related…
Check here;

I did what u sad but still the same even i restarted the computer.

You still have 3 for number of digets after decimal…

Although I have 2 but QTY in item sales report is whole numbers.

Looking at the report itself on item sales it has .Sum on qty which might be a factor.

It doesn’t have relation with the SUM or the factor its regional issue. i changed decimal from 3 to 2 but still the same problem, i found in the forum this issue they solve it with N([O.Quantity]) but still not a solution for me.

You need to share more detail to help us, we dont have access to see what you see…

you screenshot shows 3 decimal places as your regional settings, changing to 2 did this change it to 2 xeros rather than 3?

Nothing to do with regional settings but when you change your regional settings to english it works??? ok, so dismiss the sugestions from the people trying to help, clearly you know better than the rest of us and thats why your here asking fo help.

FYI it was =N([O.Quantity]) not N([O.Quantity])

Enen if you did use the = and it didnt work this is eactly why your not getting anywhere very fast because your not showing what your doing so people dont know if your making simple typo mistake thats the problem or that what your saying your doing is actually what your doing and its not being confused in termonology…

OK SORRY :smile: i know guys ur helping many people on the forum but im just blocked for more than two weeks.

here is my regional config:

Please share your Report.

I changed SambaPOS from English to French, and yes, Quantity has decimals …

[Group Sales by Amount:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent.desc,O.ExactTotal.Sum}
>Total||{REPORT ORDER DETAILS:O.ExactTotal.Sum}

[Group Sales by Quantity:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.Quantity.Percent.desc,O.Quantity.Sum}
>Total||{REPORT ORDER DETAILS:O.Quantity.Sum}

[Item Sales by Amount:2, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Percent.desc,O.ExactTotal.Sum}
>Total||{REPORT ORDER DETAILS:O.ExactTotal.Sum}

[Item Sales by Quantity:2, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Percent.desc,O.Quantity.Sum}
>Total||{REPORT ORDER DETAILS:O.Quantity.Sum}


#FIX using Format section, with [=F('{0}','0')]

These all work …

[=F({0},'0')]
[=F('{0}','0')]
[=F({0},'#')]
[=F('{0}','#')]

Syntax:

[=F('{<columnNumber>}','<formatSpec>')]

F() is a Format Number function
<columNumber> is the Column, starting with Column 0
<formatSpec> indicates how you want to format the output, for example:

'#,###.00' means comma grouping and 2 decimals exactly
'# ###.##' means space grouping and 2 decimals optionally
'0000.00' means no grouping, 4 digits before decimal exactly by left-padding with zero, 2 decimals exactly

[Group Sales by Amount:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent.desc,O.ExactTotal.Sum}
>Total||{REPORT ORDER DETAILS:O.ExactTotal.Sum}

[Group Sales by Quantity:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.Quantity.Percent.desc,O.Quantity.Sum::{0}|{1}|[=F('{2}','#')]}
>Total||{REPORT ORDER DETAILS:O.Quantity.Sum::[=F('{0}','#')]}

[Item Sales by Amount:2, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Percent.desc,O.ExactTotal.Sum}
>Total||{REPORT ORDER DETAILS:O.ExactTotal.Sum}

[Item Sales by Quantity:2, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Percent.desc,O.Quantity.Sum::{0}|{1}|[=F('{2}','#')]}
>Total||{REPORT ORDER DETAILS:O.Quantity.Sum::[=F('{0}','#')]}

… deleted double post …

… deleted triple post …

1 Like

Thats nothing to do with the forum, looking back you have had eager replies same day for pretty much every post you have made, the gap in activity was waiting on reply from you.

Can you also show your reports.
Q sugested abunch of other corrections and you didnt seem to address these.


Sppek of the devil, seems he has solution for you there.

1 Like

This is my report:

[Ventes groupées par montant:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent.desc,O.ExactTotal.Sum:(ODI=True)}
>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True)}

[Ventes groupées par quanité:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.Quantity.Percent.desc,O.Quantity.Sum:(ODI=True)}
>Total||{REPORT ORDER DETAILS:O.Quantity.Sum:(ODI=True)}

[Journal des ventes par article:5, 2, 2,1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1"}
{REPORT ORDER DETAILS:'     '+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1":2}

I get this :

Ok, so now use Q’s fix above to sort it - How to round quantité in Report
Also lok back on the topic as he also showed corrections for several other mistakes in your report which still seem to be there.

Thanks guys a lot for ur help and have nice day :wink: .
One more question isn’t an issue when changing language quantity become with decimal places, i didn’t have this issue with V3 ?

It might be that it has been hard overidden in english long time ago and forgotten maybe.
Its reigional related for sure and 3 places is your regional setup.
Expect when changed to 2 it did change to two and on that bases would expected that for english it would be 2 by default but guessing something somewhere is overiding it.

I didn’t need to change Regional Settings. They are for US English, with 2 digits after DOT decimal, with comma as thousands group symbol.

But I agree with @JTRTech that the Regional Settings in languages other than English come into play, probably because the Quantity Format is not overridden in other languages.

When you use the Output Format Section and Format Functions, the Regional Settings are overridden.


[quote=“haithem_pro, post:23, topic:15331”]
This is my report:
[/quote].

This is your Report fixed:

[Ventes groupées par montant:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent.desc,O.ExactTotal.Sum:(ODI=True)}
>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True)}

[Ventes groupées par quanité:2, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.Quantity.Percent.desc,O.Quantity.Sum:(ODI=True):{0}|{1}|[=F('{2}','0')]}
>Total||{REPORT ORDER DETAILS:O.Quantity.Sum:(ODI=True):[=F('{0}','0')]}

[Journal des ventes par article:5, 2, 2,1]
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1":{0}|[=F('{1}','0')]|{2}}
{REPORT ORDER DETAILS:'     '+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and O.MenuItemName="$1":{0}|[=F('{1}','0')]|{2}}

2 Likes

Thanks for ur help,

i hope that in further version well consider this issue because even when i fresh install sambapos v5 with french language all reports are broken.

thank u all for saving my day :wink:

I wouldn’t call decimal places broken.