Skip to content

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