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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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,215,236
Messages
6,123,799
Members
449,127
Latest member
Cyko

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