Jump to content
Medved Trader Forums
  • 0

Truncate large numbers


Kasper

Question

9 answers to this question

Recommended Posts

  • 0

we do on places like labels. But in fields where the values are shown, they must be fully shown. if you have 20,000,000, you need to be able to tell if it changes to 20,000,500 and just because something has high volume for the day does not mean it is flowing fast now, so cannot assume that those last digits are insignificant

Link to comment
Share on other sites

  • 0

No, seriously. C# doesn't include in its libraries the "AlmostEquals" kind of function for floats. So I had to write it myself.

It is a non trivial problem. The most precise method would be of course to decode the IEEE float into its exponent/fraction components and then compare them. I settled for a different method that unfortunately involves calling log functions etc. It is a little slower but I think more clear. But I of course screwed it up. Fixed now. Will be in next ver.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...