-
Notifications
You must be signed in to change notification settings - Fork 10
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
Added rounding to Cost and Rate for storage invoice #161
Conversation
src/coldfront_plugin_cloud/management/commands/calculate_storage_gb_hours.py
Outdated
Show resolved
Hide resolved
src/coldfront_plugin_cloud/management/commands/calculate_storage_gb_hours.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some quick googling. The format method with the >>> a
Decimal('9E-9')
>>> str(a)
'9E-9'
>>> format(a, 'f')
'0.000000009' |
Cost will now be rounded to 2 decimal points Rate will be rounded to 6 decimal points, since the Openshift Gb/hr rates at the time of this commit is $0.000009
1d599cb
to
775afd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have fixed the rounding but you haven't fixed the way rate is written to file.
@knikolla @naved001 I reverted the change to rates, so now an
When I run the script with this command: My output invoice seems to be the desired output?
|
I see, then perhaps the bug is with how If you go to |
@QuanMPhm It seems to be that the issue is not with how it is written in this file but in
>>> a = "0.000009"
>>> float(a)
9e-06
>>> Decimal(a)
Decimal('0.000009') |
Closes #157, Cost will now be rounded to 2 decimal points
Rate will be rounded to 6 decimal points, since the Openshift Gb/hr rates at the time of this commit is $0.000009