c# - Simple calculation -


in excel have simple calculation:

total = £103000   percent: 2.14%   charges = £2,199.05 - excel formula (total*percent)/100 

in c# can't calculate correctly:

double percent = 2.14; double total = 103000; double charges = (total * percent) / 100; 

returns £2,204.20

i'm sure there rounding going on somewhere making calculation incorrect.

i wouldnt expect spreadsheet incorrect, provided financial advisor/expert!

i've uploaded version of spreadsheet here:

see page/tab 2 calculations, cell k20 charges appear

i did algebra , real value 2.135%.

examining spreadsheet provided via google docs confirms actual percentage 2.135%. 2.14% displayed due format settings.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -