The .html method is returning a string value.   So, you're adding
"14.56" and "85.00" to create "14.5685.00"

You need to convert the a and b variables to a numeric class.  In this
case, you want to use .to_f:

total = a.to_f +  b.to_f

Hope that helps.

orde

On Feb 8, 12:45 pm, tester86 <sagar.am...@gmail.com> wrote:
> Sorry but in IRB when I do
>
> a= $b.table(:index, 1)[2][11].html
> print 14.56
>
> b=$b.table(:index, 1)[2][11].html
> print 85.00
>
> total = a +  b
>
> in IRB it returns 14.5685.00
>
> when it should return 99.56

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to