Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subtraction using variables

Status
Not open for further replies.

elly00

Technical User
Jun 30, 2011
69
IT
Hi

I have two variables like

a=1.22
b=1.55
operation is:
c=a-b

The problem is that the variable C dosn't have decimals..so the result when I write the variable is 0 and not 0.33

How can i format this operation in order to mantain the decimals?

Thanks
 
Think you need to show us your code, as - with the info provided so far - c certainly ought to have decimals. And does here. This simple program shows the correct result:

a=1.22
b=1.55
c=a-b
MsgBox c

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top