# Convert string to integer

**URL:** https://www.finalbuilder.com/forums/t/convert-string-to-integer/1070
**Category:** Discussion
**Created:** [January 7, 2009, 3:27am UTC](https://www.finalbuilder.com/forums/t/convert-string-to-integer/1070 "2009-01-07T03:27:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![efridman](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/a88e57/32.png) [@efridman](https://www.finalbuilder.com/forums/u/efridman)
#### Post date: [January 7, 2009, 3:27am UTC](https://www.finalbuilder.com/forums/t/convert-string-to-integer/1070/1 "2009-01-07T03:27:12Z")

</div>

Hi

&nbsp;

I there an easy way to convert string to integer ?

I tried to use "Set Variable" action with Force type as integer but when for example the string is 05 it convert it to 0 and not 5. As I want

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [January 8, 2009, 12:47pm UTC](https://www.finalbuilder.com/forums/t/convert-string-to-integer/1070/2 "2009-01-08T12:47:41Z")

</div>

Which version/build of finalbuilder are you using?   
  
 I’m not able to reproduce this here… In the set variable action, I set it to use the existing value, no modifier and force the type to integer. In the after action script event I added the following javascript :   
  
 alert(FBVariables.MyNumber.toString())   
  
 It displays 2 as expected. If this does not happen for you please send an example that shows the problem to support and we will investigate.

---

<div class="post-metadata">

### Author: ![efridman](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/a88e57/32.png) [@efridman](https://www.finalbuilder.com/forums/u/efridman)
#### Post date: [January 11, 2009, 10:56am UTC](https://www.finalbuilder.com/forums/t/convert-string-to-integer/1070/3 "2009-01-11T10:56:08Z")

</div>

Sorry, FinalBuild work OK. it was my mistake.
