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

Implement fmt.Formatter #366

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

u5surf
Copy link

@u5surf u5surf commented Apr 23, 2024

We would like to get started implement the fmt.Formatter. At first, we implement the indicators of '%s' and '%f'.

'%s' is due to compatibility for conventional behavior.

* Fixes shopspring#326
* We would like to get started implement the fmt.Formatter.
* At first, we implement the indicators of '%s' and '%f'.
func (d Decimal) Format(f fmt.State, verb rune) {
switch verb {
case 'f':
places, _ := f.Precision()
Copy link
Contributor

Choose a reason for hiding this comment

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

how does this work for plain %f without precision specified?

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.

Implement fmt.Formatter
2 participants