You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by André Mud <an...@testdynamics.nl> on 2009/01/22 22:27:57 UTC
Javascript
In my script i use the regex function to extract a number. This number
however is a string "0000856756".
I need to remove the leading 4 zero's. I tried to use the __Javascript
function with the function parseInt and parseFloat, but I get a message
"NaN" which probably means that the string isn't a number.
How do I convert the string into a number, or is there another way to do
this?
I also tried to adjust the regex function to '0000(.+?)\"); but this didn't
work either.
Help will be appriciated.
Andre Mud
--
View this message in context: http://www.nabble.com/Javascript-tp21613736p21613736.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Javascript
Posted by sebb <se...@gmail.com>.
On 22/01/2009, André Mud <an...@testdynamics.nl> wrote:
>
> In my script i use the regex function to extract a number. This number
> however is a string "0000856756".
> I need to remove the leading 4 zero's. I tried to use the __Javascript
> function with the function parseInt and parseFloat, but I get a message
> "NaN" which probably means that the string isn't a number.
> How do I convert the string into a number, or is there another way to do
> this?
>
> I also tried to adjust the regex function to '0000(.+?)\"); but this didn't
> work either.
Try
"0*(\d+)"
> Help will be appriciated.
>
> Andre Mud
>
> --
> View this message in context: http://www.nabble.com/Javascript-tp21613736p21613736.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org