diff --git a/source/IJSVGUnitLength.m b/source/IJSVGUnitLength.m index 7843571..f290a98 100644 --- a/source/IJSVGUnitLength.m +++ b/source/IJSVGUnitLength.m @@ -58,7 +58,7 @@ - (CGFloat)computeValue:(CGFloat)anotherValue { if(self.type == IJSVGUnitLengthTypePercentage) { - return ((anotherValue/100)*self.value); + return ((anotherValue/100.f)*(self.value*100.f)); } return self.value; } @@ -76,4 +76,9 @@ return [NSString stringWithFormat:@"%g",self.value]; } +- (NSString *)description +{ + return [NSString stringWithFormat:@"%f%@",self.value,(self.type == IJSVGUnitLengthTypePercentage ? @"%" : @"")]; +} + @end