# File lib/eymiha/math/fraction.rb, line 16 def with_fraction(denominator=1,separator='-',show_zero=false) sign = self <=> 0 unsigned = self*sign whole = (((unsigned*denominator).round)/denominator).floor numerator = ((unsigned-whole)*denominator).round "#{sign*whole}#{(numerator != 0)||show_zero ? "#{separator}#{numerator}/#{denominator}" : ""}" end