TheRedMelon Posted March 19, 2019 Report Posted March 19, 2019 First of all I'm using C#, not node.js; I'm not sure where to ask so I thought I'd try here. I have the 'SkinData.paintwear' value as a uint from CS:GO. I'd like to show it as an accurate 16 decimal place value, but I can't figure out how.So far I have: Convert.ToDouble(BitConverter.ToSingle(BitConverter.GetBytes(client.SkinData.paintwear), 0)) But this returns only 15 decimal places, and the 15th is rounded.How can I get the extra decimal place? Quote
Dr. McKay Posted March 20, 2019 Report Posted March 20, 2019 Get rid of the Convert.ToDouble call. Quote
TheRedMelon Posted March 20, 2019 Author Report Posted March 20, 2019 Doesn't work, BitConverter.ToSingle(BitConverter.GetBytes(client.SkinData.paintwear), 0) just leaves it as a single, showing only 6 digits after the decimal point. Quote
Dr. McKay Posted March 21, 2019 Report Posted March 21, 2019 The value is a single-precision float. A double will give you the wrong value. It sounds like whatever you're using to display it is truncating the number of decimals, so you should go check that. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.