Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bankers Rounding or Engineering Rounding - Functional on Servers #793

Open
ZoeMillerUSACE opened this issue Nov 18, 2024 · 1 comment
Open
Labels
feature A desired feature priority-medium Baseline priority. request if a feature has just been requested

Comments

@ZoeMillerUSACE
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A banked python algorithms/function/tool that does bankers rounding (also sometimes referred as engineering rounding). https://docs.alipayplus.com/alipayplus/alipayplus/reconcile_mpp/bank_rounding?role=MPP&product=Payment1&version=1.5.5

Describe the solution you'd like
Like regular rounding though ,it is ideal that this rounding works for various sig figs - for example rounding to the 2nd decimal place or the hundreds or thousands.

Describe alternatives you've considered
manually creating and testing algorithms for each type of sig fig and having to copy and paste it into each algorithm over and over.

Additional context
Based on my limited understanding - this does not need to be complicated - but when I have tried running an algorthm with things like "trunc" or regular "round" I will get different answers on windows PC python and the server. Perhaps this has to do wit hthe python version or some computer science background that I am not too familiar with, but having a tool that is reliable baked into OpenDCS would make implementing a number of functions much simpler.
@oskarhurst Might have some thoughts on this - or have some insight into why this has been a challenge or may be one moving forward?

@ZoeMillerUSACE ZoeMillerUSACE added priority-medium Baseline priority. feature A desired feature request if a feature has just been requested labels Nov 18, 2024
@MikeNeilson
Copy link
Contributor

It's surprising that windows vs unix would be that different, but they would call different C libraries to affect the operation... though Trunc should always be the same, by definition.

What I'd like to see included is a method of specifying rounding similar to units and a easy to use drop down to boot.
basically provide by default:

  • noop (don't round, just pass the value through)
  • USGS format spec
  • Bankers as requested here

But use a mechanism like the algorithms such that a downstream user can define an additional arbitrary rounding if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A desired feature priority-medium Baseline priority. request if a feature has just been requested
Projects
None yet
Development

No branches or pull requests

2 participants