Issue in Lables while Printing the Output

Dheepak

Board Regular
Joined
Aug 25, 2013
Messages
64
Hi All,

I need a your help on below issue.

Value of Label 1 is 50
Value of Label 2 is 50.01

When i print the difference result in label 3 its showing as 9.99999999999801E-03 but it should print 0.01

Here is the code that i wrote.

Code:
Label3= Label2-Label1

Could you please help me how to print the correct value and also code.

Thanks in Advance!!!!

Regards,
Dheepak

 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Code:
Label3 = Format(Label2-Label1,"0.00")

with the Format() function you can format any numbers or date/time exactly like on a spreadsheet with the number formatting

Format(Date,"yyyy-mm-dd") 2013-10-15
"Invoice - " & Format(1,"000") Invoice -001
etc
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top