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

Bids 2613/add tooltips to withdrawals for full amount #2738

Merged
merged 5 commits into from
Nov 30, 2023

Conversation

D13ce
Copy link
Contributor

@D13ce D13ce commented Nov 29, 2023

This PR adds another parameter to various EL/CL value formatting functions: truncateAndAddTooltip
It will truncate (no rounding) decimal places if there are more than digitsAfterComma. If digits are truncated, a tooltip for the complete amount is shown.
If truncateAndAddTooltip is set and there are less than digitsAfterComma, trailing 0s will be added.

This is only used for withdrawal-related numbers.

Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines +230 to +235
dotIndex := strings.Index(valStr, ".")
if dotIndex >= 0 {
missingZeros := digitsAfterComma - (len(amountStr) - dotIndex - 1)
if missingZeros > 0 {
amountStr += strings.Repeat("0", missingZeros)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Nicely compact.

@D13ce D13ce merged commit f419e7d into master Nov 30, 2023
@D13ce D13ce deleted the BIDS-2613/AddTooltipsToWithdrawalsForFullAmount branch November 30, 2023 13:42
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.

2 participants