1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2016
    Rep Power

    Thumbs up How to convert feet and inches into inches using classic .asp

    I have thousands of different sizes that I need to convert from feet and inches into inches using classic .asp.

    The sizes are listed in the following format:

    [width] x [height]

    The width and height are shown with ' marks, which stand for feet and " marks which stand for inches.

    For example, take the following and convert it into inches:

    2'6" x 8' = width = 30; height = 96
    9'6" x 13'6" = widht = 120; height = 162

    Sometimes there is no X in the size, indicating that it is round or square in shape. For example:


    That would have to make both the width and height the same, so:

    2'6" = width = 30; height = 30

    Sometimes, there is a trailing " at the end, where there should be inches, but there are none listed. For example:

    5'0" x 8'" = width = 60; height = 96

    I am guessing that I would need to create some sort of custom function with expressions, but just having a hard time figuring it out. Any pointers would be appreciated.
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Rep Power
    Maybe take a look at regex and string handling functions that you can use to parse out the desired values from the input. All the vbscript functions are documented on the microsoft web site.
    Doug G
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton

IMN logo majestic logo threadwatch logo seochat tools logo