decimal vs double! - Which one should I use and when?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

decimal vs double! - Which one should I use and when?

Message par ForumBot »

decimal vs double! - Which one should I use and when?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: decimal vs double! - Which one should I use and when?

Message par ForumBot »

For money, **always** decimal. It's why it was created.

If numbers must add up correctly or balance, use decimal. This includes any financial storage or calculations, scores, or other numbers that people might do by hand.

If the exact value of numbers is not important, use double for speed. This includes graphics, physics or other physical sciences computations where there is already a "number of significant digits".
Répondre

Revenir à « .NET & C# »