diff options
Diffstat (limited to 'src/types.cc')
| -rw-r--r-- | src/types.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/types.cc b/src/types.cc index e86e999c..37666701 100644 --- a/src/types.cc +++ b/src/types.cc @@ -20,6 +20,7 @@ #include "raw_convert.h" #include "types.h" #include "exceptions.h" +#include "compose.hpp" #include <boost/algorithm/string.hpp> #include <vector> #include <cstdio> @@ -43,6 +44,12 @@ Fraction::Fraction (string s) denominator = raw_convert<int> (b[1]); } +string +Fraction::as_string () const +{ + return String::compose ("%1 %2", numerator, denominator); +} + bool dcp::operator== (Fraction const & a, Fraction const & b) { |
