I thought this would be simple, but searching Google didn\'t seem to help.
I\'m basically trying to write a function which will return a ratio as a string (eg 4:3) w
Having played with such things in the past, I'll just add that dealing with signed values can get ugly. Let me suggest that the simplest way to handle signed values is to apply Konrad's approach to the absolute values of your original numbers, then prepend a '-' to the resulting string if the original values have different signs.
Using this approach, the Greatest Common Divisor of -100 and -35 is 5, for a ratio of 20:7. If the original inputs had been either of the pairs (-100 and 35) or (100 and -35), you'd still get a GCD of 5, and an initial result of 20:7, but the final answer would be -20:7 (i.e. standardized form regardless of which input was negative, just as both -6/2 and 6/-2 = -3).