shadowspore / t38c

Tile38 Client package
MIT License
83 stars 33 forks source link

Format floats to allow for very large/small values #52

Closed buddy-sandidge closed 2 years ago

buddy-sandidge commented 2 years ago

This is to resolve issue 51 https://github.com/shadowspore/t38c/issues/51

Using strconv.FormatFloat(val, 'g', 10, 64) to format floats means that very large or very small numbers will be rounded. For example, a value of 123456789012345680 will be saved as 123456789000000000. By using -1 for precision means the smallest number of digits will be used to represent a float exactly.