Hi all,
I'm new to this forum and I just signed up because I couldn't find a way to solve this issue:
I am making a list of roughly 15000 articles with dimensions and all, however, some dimensions are Imperial. these dimensions are written as EG: 1 1/4, 1 1/2 etc.
everything works as planned but the problem is that in my product managemnt system one field is prescribed to contain these fractions in the following form: 5/4, 3/2 etc.
Is there any way to automate this field by using either functions or formatting options?
in PHP I already made an example of what the script should do:
$fraction = "1 3/4";
$whole = explode(" ", $fraction);
$tn = explode("/", $whole[1]);
$w = $whole[0];
$t = $tn[0];
$n = $tn[1];
$new = (($w * $n)+ $t)."/".$n;
echo "Old: ".$fraction."<br />";
echo "New: ".$new;
in layman's terms:
2 1/4 ---> A= 2, B= 1, C= 4
Newfraction = ((A * C)+ B)/C = 9/4
I could use the LEFT() and COUNT() functions intertwined with each other (to seperate the numbers) but this would make an highly unstable and large formula.. It sjhould be easier in my opinion...
I hope you can help me!
Thanks
Bookmarks