easyjson icon indicating copy to clipboard operation
easyjson copied to clipboard

feat: add float_format flag

Open rhnvrm opened this issue 3 years ago • 4 comments

This commit adds a float_format flag to easyjson which allows users to change the float format used in strconv. The default flag used is g by easyjson which is kept as is to avoid a breaking change.

If a user wishes, they can now provide a flag such as: bin/easyjson -float_format='f' ./tests/float_format.go

The g format converts long floats into e-notation. Using a flag such as 'f' might be necessary for certain use cases to maintain backward compatibility.

rhnvrm avatar Mar 21 '22 11:03 rhnvrm

Hey @bulletmys, we internally use this patch and were wondering if it would be possible to upstream it? Since there was not much activity on the repo recently, thought to ping.

rhnvrm avatar Mar 21 '22 12:03 rhnvrm

Hi @GoWebProd

Just wanted to bump this up.

rhnvrm avatar Oct 11 '22 09:10 rhnvrm

@GoWebProd @bulletmys

Apologies for bumping this. We have been using the fork in production since March 2022. Would love to get it upstreamed. If any suggestions/tweaks I can do to align it with the project do let me know, would be happy to work on it.

rhnvrm avatar Aug 21 '23 11:08 rhnvrm

+1 Would be great if this PR could be considered.

knadh avatar Nov 17 '23 05:11 knadh