18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

adding values with decimal or float..

tinchie8tinchie8 Members
edited November -1 in Sahi - Open Source
Hi,

when i tried this one:

var $value = 1.2;
for (var $ctr=0; $ctr <= 4; $ctr++){
_setValue(_textbox("txt_value"), $value);
$value = $value + 0.1;
}

i got these results for $value:

1.2
1.3
1.4000000000000001
1.5000000000000002


.... how do i make 1.4000000000000001 and 1.5000000000000002 to be just 1.4 and 1.5??

in C we got this %.2f, but in SAHI i dont know how to do this.....

Anyone know how??

would greatly appreciate your help...

Thanks
=Tinchie=

Comments

Sign In or Register to comment.