Skip to content

Correctly format amounts of less than 10 cents#591

Open
FriesischScott wants to merge 1 commit intooss-apps:mainfrom
FriesischScott:fix-single-digit-cent-display
Open

Correctly format amounts of less than 10 cents#591
FriesischScott wants to merge 1 commit intooss-apps:mainfrom
FriesischScott:fix-single-digit-cent-display

Conversation

@FriesischScott
Copy link
Contributor

Description

Amounts of less than 10 cents are currently formatted incorrectly. For example 1 cent (represented as 1n) is rendered as $0.1.

When simplifyDepts results in very small amounts they render incorrectly and do not add up to the correct depts anymore.

The issue is fixed by padding the string with the appropriate number of zeros.

I've also added a corresponding test.

Checklist

  • I have read CONTRIBUTING.md in its entirety
  • I have performed a self-review of my own code
  • I have added unit tests to cover my changes
  • The last commit successfully passed pre-commit checks

Amounts of less than 10 cents where incorrectly formatted such that one
cent would render as 0.1. The issue is fixed by padding the string with
the appropriate number of zeros.

I've also added a corresponding test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant