Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Get rid of -symbol

    This is my script:
    this.getField ("available hours").value = this.getField("hours used to date").value - this.getField("Text8").value;

    however it shows the - sign how do I get ride of it?

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    parseInt()
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,918
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Quote Originally Posted by WolfShade View Post
    parseInt()
    No. Math.abs()


    Quizmaster: What was the name of King Henry VIII's warship raised in 1982?
    Contestant: The Jolly Roger

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #4
    Regular Coder
    Join Date
    Mar 2006
    Posts
    726
    Thanks
    35
    Thanked 132 Times in 123 Posts
    Philip's solution will remove the minus sign- but you should make sure you are subtracting the correct value.

    Perhaps you should reverse the order in your expression.

    this.getField ("available hours").value =
    this.getField("Text8").value-this.getField("hours used to date").value;

    Of course it depends on what your fields represent.


  •  

    Posting Permissions

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