mercredi 27 juin 2018

Rounding to two decimal places is not working

I am trying to reduce the decimal places of my number to two. Unfortunately is not possible. For this reason I added some of my code, maybe you will see the mistake...

Update [dbo].[company$Line] SET Amount = ROUND((SELECT RAND(1) * Amount),2), ... SELECT * FROM [dbo].[company$Line]

Amount in db which I want to change:

0.00000000000000000000 1914.65000000000010000000 376.81999999999999000000 289.23000000000002000000

Result I get after executing the code:

0.00000000000000000000 1366.28000000000000000000 268.89999999999998000000 206.38999999999999000000

Result I want to get (or something like this):

0.00 1914.70 376.82 289.23




Aucun commentaire:

Enregistrer un commentaire