Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ASP Multiplication

  • 23-03-2006 11:48am
    #1
    Registered Users, Registered Users 2 Posts: 224 ✭✭


    Hi,

    Im looking to divide one field by another and display the answer on the same page...anybody know the coding behind that.

    Cheers


Comments

  • Registered Users, Registered Users 2 Posts: 2,647 ✭✭✭impr0v


    <%
    Dim result
    result = ((my_recordset.Fields.Item("field1").Value)/(my_recordset.Fields.Item("field2").Value))
    response.write(result)
    %>
    

    Edit: initially read multiply instead of divide!


  • Registered Users, Registered Users 2 Posts: 224 ✭✭The Mighty Dubs


    legendary. That works brilliantly but Sorry to be a pain but my results are coming up like this 1.35833333333333. Is it possible to return an answer like this 1.35???


  • Moderators, Politics Moderators Posts: 41,217 Mod ✭✭✭✭Seth Brundle


    http://www.w3schools.com/vbscript/func_round.asp will round off numbers - however reducing 1.358... to 1.35 is more like just taking the leftmost 4 characters - use the left function


Advertisement