I have an array of strings that represent sizes.
A list of all format variations is below:
- 2x3
- 3.6x5.6
- 6'RD
Goal: Convert to these formats:
- 2' x 3'
- 3' 6'' x 5' 6''
- 6' ROUND
All values are currently being pushed into an array called @sizearray like so:
push(@sizearray, $data[$size_num]);
Then,
my @formattedsize = @sizearray;
foreach (@formattedsize) {
if ($formattedsize[$_] =~ /(\d+)x(\d+)/) {
#convert to
if (???) {
#???
}
if (???) {
#???
}
}
How would I go through each element in the array and save the values into a new array with the new format?