dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Help with Javascript for on the fly calculations on mobile app

  1. #1
    Join Date
    Mar 2013
    Posts
    2

    Help with Javascript for on the fly calculations on mobile app

    I am looking for the code to help me with a calculation in a mobile app I am trying to build. I need script that calculates the following:

    Value A = diameter
    Value B = length
    Value C = total weight

    Value A times Value B equals Value C

    example:
    Value A = 49
    Value B = 14
    Value C = 686

    Can someone please help. This is my first venture ever dealing with code.

    Thanks
    CMD

  2. #2
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,276
    There is no need of mobile to calculate 14 times 50 (which is 700) and to subtract 14 to find 14 times 59 !

  3. #3
    Join Date
    Mar 2013
    Posts
    2
    I am not sure I am following you. Value A and Value B will change each time depending on what the client selects which in turn will cause Value C to change.

  4. #4
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,276
    Then follow this recipe

    Ingredients :
    3 inputs : 2 type text and 1 button to display the result
    1 result container (p or div)
    Time
    : 5 minutes.
    Equipment :
    1 Text editor
    Many browsers with console and development tools to test the script.
    Preparation steps
    1/- Load your favourite template for a page
    2/- Display the ingredients with a little CSS
    3/- Display a onclick event on the button to call a function which read the to values and return the result.
    4/- Write the script which should not be a problem.Multiplication automatically converts strings (read with document.getElementById) to numbers.
    Number of servings : More than for or five thousand men with phone

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles