Rounding issue

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Rounding issue

Post by Karl-Heinz »

Hi Jeff,

if it doesn´t help what Robert suggests, you should search the web with keywords like "math round australian cent". i´m pretty sure there's no need to reinvent the (formula) wheel.

regards
Karl-Heinz
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Rounding issue

Post by Karl-Heinz »

Interesting - at least to me - is the statement below about the difference if a payment is made by cash or by electronic transaction.

https://stackoverflow.com/questions/751 ... increments

[...]
As an Australian I have to dispute your assertion that all currency here is in .05 increments. All cash payments are in .05 increments because our smallest denomination coin is the 5c, but any electronic transactions, or old-school paper-based credit card or cheque transactions (including, obviously, AMEX transactions) are to the nearest cent. Do not even think about rounding to nearest 5 cents unless your customer is paying cash.
[...]

regards
Karl-Heinz
BiggyRat

Rounding issue

Post by BiggyRat »

Hi Robert, No, that didn't work - at least if I've understood you correctly.


? Round(((self:oDCQTY1:VALUE * self:oDCUNITPR1:VALUE) * nGSTInc)*2,1)
? ((self:oDCQTY1:VALUE * self:oDCUNITPR1:VALUE) * nGSTInc)/2

In the example where

oDCQTY1:Value is 1
oDCUNITPR1 is 126.50
nGSTInc is 10

Result = 134.14

It should be rounded up to 134.15 (see below)
Robert.JPG
Robert.JPG (30.61 KiB) Viewed 520 times
Robert2.JPG
Robert2.JPG (22.07 KiB) Viewed 520 times
Karl-Heinz, interesting yes, but useless fact nonetheless. The quoted statement is legally true, however, "the customer is always right" and they're insisting on the rounding. To be honest, it's not a particularly strange request, MYOB Accounting software does it as I believe does Xero.

Thanks again guys.

Jeff
User avatar
robert
Posts: 4529
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Rounding issue

Post by robert »

Jeff,
There must be something wrong in your code. I tried my formula in excel and see the following:
1,21 1,22 1,23 1,24 1,25 1,26 1,27 1,28 1,29 1,30
2,42 2,44 2,46 2,48 2,50 2,52 2,54 2,56 2,58 2,60
2,40 2,40 2,50 2,50 2,50 2,50 2,50 2,60 2,60 2,60
1,20 1,20 1,25 1,25 1,25 1,25 1,25 1,30 1,30 1,30

- row 1 = 'raw value'
- row 2 = value * 2
- row 3 = row 2, rounded to 1 decimal
- row 4 = row 3 divided by 2

I think the rounding to 0,05 works exactly like expected.
XSharp Development Team
The Netherlands
robert@xsharp.eu
BiggyRat

Rounding issue

Post by BiggyRat »

I just don't get why this is so hard. The Australian dollar is just a decimal system. Hardly unusual.
User avatar
wriedmann
Posts: 3757
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Rounding issue

Post by wriedmann »

Hi Jeff,
you are really trying to make it as hard as possible to help you and to waste others time as much as possible.

If you initially had posted what your rounding requirements were, like:
1.05 -> 1.00
1.06 -> 1.10
the entire thread would have been 3 or 4 messages long, and you had a solution in a few hours.
So you have lost hours not only of your time, but also Roberts, Karls, Karl-Heinz's and mine.
The problem is not the Australian Dollar, but that you are not clear about your own requirements.
First you need to be clear about them, and then you should try to formulate your requests as clear as possible.
Otherwise people will not be able to help you.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4529
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Rounding issue

Post by robert »

Jeff,
I echo what Wolfgang said: Specify what you expect to get and then we'll be able to help you.
And this is not the first time you have not given us everything we needed to reproduce and fix your problems.
Remember the report with the image that was too big where you did not include that image, so we could not reproduce your "out of memory" issue?


Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
BiggyRat

Rounding issue

Post by BiggyRat »

What the hell else can i give you guys? You have ALL the code, all the resultant screenshots of resultant code, HOW HAVE I NOT GIVEN YOU BLOKES ENOUGH INFORMATION? Seriously. It's not rocket science you multiply two numbers together each with 2 decimal places, get the product of those two and multiply it by another number, also on 2 decimal places. What have I NOT EXPLAINED? Why is it so hard for you to understand? Why, once again, have I NOT given you lot enough information? You have 100% reproducible code. Something you harp on incessantly, yet you accuse me of not giving you enough information. Is this a language barrier thing? Thats the only thing I can think of.

Seriously if I explain a problem in PLAIN, SIMPLE ENGLISH is too hard for you to understand, then there's no chance of me testing the X Sharp waters where I admit I'm starting off out of my depth.
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Rounding issue

Post by FFF »

May i kindly remind you: it is YOU, who wants help, for free. So, take a step back, calm down, rethink, what people tried to explain, then come back.
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
BiggyRat

Rounding issue

Post by BiggyRat »

The point is im not getting help. Free or otherwise is not the point. People aren't reading my posts, just rolling their eyes and dissing me, then accuse me of not giving you guys enough information. Tell me Karl READ ALL MY POSTS IN THIS THREAD ,then tell me what more i can tell you, other than the answer. I have been so polite and appreciated all the help given, but I'm sick of being accused of not giving you enough information, and then when I do, I get accused of supplying "massive files", and sending too many emails, even each one explained in detail changes in code to attempt to fix the problem and the results of such changes... WTF else am i logically be expected to do?
Post Reply