Posts: 2
Threads: 1
Joined: Nov 2010
Reputation:
0
11-19-2010, 05:20 AM
I'm kind of a newbie with QTP; can do most basic stuff. I have a very large number I need to crop, and cannot find anything in the books I have about cropping the number. The number is $2,459.000.168, and I just need it to be $2,459.00
Any help would be greatly appreciated!
Thx!
Posts: 30
Threads: 5
Joined: Mar 2009
Reputation:
0
11-19-2010, 06:37 AM
Hi..
You can use Round() to get u r required Result..
Ex :
val = 2,459.000.168
val = Round(2,459.000.168, 2) -- now val contains 2,459.00
val = Round(2,459.000.168, 3) -- now val contains 2,459.000
Thx..
Posts: 99
Threads: 0
Joined: Oct 2010
Reputation:
0
11-19-2010, 11:18 AM
Hi
val = 2459000.16866
val = Round(2459000.16866, 2) -- now val contains 2,459,000.17
val = Round(2459000.16866, 3) -- now val contains 2,459,000.168
ALSO
val = 2459000.16866
val = FormatNumber(2459000.16866, 2) '-- now val contains 2,459,000.17
val = FormatNumber(2459000.16866, 3) '-- now val contains 2,459,000.168
will give same result
Nandu, Round(2,459.000.168, 2) -> You can't pass arguments like this, will get error i guess.