locked
Is decimal used exclusively in calculating financial numbers these days? RRS feed

  • Question

  • User-858993849 posted

    Googling 'decimal vs money vs float" for financial applications comes back to always use decimal at the cost of performance of its accuracy.  But most of the comments I see are very old.  Numerous comments are that  money and decimal(18, 4) are the same, but stay away from float.

    Is the rule of thumb still the same today, use decimal vs float for all financials?

    Saturday, February 25, 2017 12:39 PM

Answers

  • User475983607 posted

    Is the rule of thumb still the same today, use decimal vs float for all financials?

    You should use decimal when working with money.  Float calculations use binary math and often there's no exact match between the floating point number and its binary representation.  Therefore calculations result in  a loss of precision which is not acceptable in calculations that involve currency.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 25, 2017 12:53 PM

All replies

  • User475983607 posted

    Is the rule of thumb still the same today, use decimal vs float for all financials?

    You should use decimal when working with money.  Float calculations use binary math and often there's no exact match between the floating point number and its binary representation.  Therefore calculations result in  a loss of precision which is not acceptable in calculations that involve currency.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 25, 2017 12:53 PM
  • User-858993849 posted


    Thanks!

    Saturday, February 25, 2017 1:22 PM