A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] parseInt(TextInput.text) is stripping my decimal

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    197

    [F8] parseInt(TextInput.text) is stripping my decimal

    I’m using flash 8 and programming with as1.

    I have a question about the parseInt() function.

    I'm pulling a number from a TextInput component and am noticing that the parseInt() function is deleting the numbers decimal.

    Example: if I have 13.5 in a textInput and pull it out via:
    parseInt(TextInput.text)
    It will give me 13 even.

    Does anybody know how to retain my decimal in this case?

    Thanks!

  2. #2
    5+5=55 Schfifty Five's Avatar
    Join Date
    Jun 2006
    Posts
    698
    ParseInt only parses integers, or whole numbers, so it truncates the decimal... use parseFloat instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center