You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into some strange behaviour when converting values to strings that require rounding up. For example, see the code snippet below:
varb decimal.Bigb.SetString("9.996208266660")
fmt.Println(fmt.Sprintf("%.2f", &b)) // Should be 10.00, but is 1.000b.SetString("0.9996208266660")
fmt.Println(fmt.Sprintf("%.2f", &b)) // Should be 1.00, but is 0.100
Other values appear to be fine – this appears to only happen when rounding up to include an additional digit, almost as if the decimal point is being outputted 1 position left from where it should be. Any idea why this may be happening? More examples can be found here. Thanks!
The text was updated successfully, but these errors were encountered:
I just noted I'm also having this issue and it seems like a serious problem. Rounding up to include an additional digit happens all the time and causes some really strange effects on the UI. :-(
I've run into some strange behaviour when converting values to strings that require rounding up. For example, see the code snippet below:
Other values appear to be fine – this appears to only happen when rounding up to include an additional digit, almost as if the decimal point is being outputted 1 position left from where it should be. Any idea why this may be happening? More examples can be found here. Thanks!
The text was updated successfully, but these errors were encountered: