﻿function GetFractionDecimal(fraction) {
    var theDecimal = 0.00;
    switch (fraction) {
        case "1/8":
            theDecimal = 0.125;
            break;
        case "1/4":
            theDecimal = 0.25;
            break;
        case "3/8":
            theDecimal = 0.375;
            break;
        case "1/2":
            theDecimal = 0.5;
            break;
        case "5/8":
            theDecimal = 0.625;
            break;
        case "3/4":
            theDecimal = 0.75;
            break;
        case "7/8":
            theDecimal = 0.875;
            break;
    }
    return theDecimal;
}
//

function GetDecimalFraction(pdecimal) {
    var theFraction = '';

    if (pdecimal == 0.125)
        theFraction = "1/8";

    if (pdecimal == 0.25)
        theFraction = "1/4";

    if (pdecimal == 0.375)
        theFraction = "3/8";

    if (pdecimal == 0.5)
        theFraction = "1/2";

    if (pdecimal == 0.625)
        theFraction = "5/8";

    if (pdecimal == 0.75)
        theFraction = "3/4";

    if (pdecimal == 0.875)
        theFraction = "7/8";
    //

    return theFraction;
}