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

Show financial figures to two decimal places #14

Open
Iain-S opened this issue Mar 22, 2024 · 1 comment
Open

Show financial figures to two decimal places #14

Iain-S opened this issue Mar 22, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@Iain-S
Copy link
Contributor

Iain-S commented Mar 22, 2024

For rctab sub summary, and possibly other commands, we output the raw data as returned by the server. This means that financial figures are shown to many decimal places:

rctab sub summary --subscription-id 1234z-1234a-1234b-1234c
[
    {
        ...
        "total_cost": 78.18015651709896
    }
]

However, it would be nice to either:

a. Show figures to to two decimal places by default, or
b. Show some shell trick to accomplish the same thing.

@joseph-palmer
Copy link
Contributor

a. Can be achieved by placing item["total_cost"] = round(item["total_cost"], 2) After item.pop("role_assignments")

@Iain-S Iain-S added the good first issue Good for newcomers label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants