on dev help sign in
decimal point
commit91cb7918206e114dc17767932635548b80e10ddb authorEitan Chatav <eitan.chatav@gmail.com> dateMon 3 Jul 2017, 15:02 (9 years ago) parent4dcfe91
1 file changed+3−3
squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+3−3
squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+3−3
@@ -133,15 +133,15 @@ instance PGNum ty
133133 (*) = unsafeBinaryOp "*"
134134 abs = unsafeFunction "abs"
135135 signum = unsafeFunction "sign"
136− fromInteger = UnsafeExpression . fromString . show
136+ fromInteger = UnsafeExpression . (<> ".") . fromString . show
137137
138138instance PGFractional ty
139139 => Fractional (Expression params tables ('Required (nullity ty))) where
140140 (/) = unsafeBinaryOp "/"
141141 fromRational x = UnsafeExpression $ mconcat
142− [ fromString (show (numerator x))
142+ [ fromString (show (numerator x)) <> "."
143143 , "/"
144− , fromString (show (denominator x))
144+ , fromString (show (denominator x)) <> "."
145145 ]
146146
147147instance (PGFloating ty, PGCast 'PGNumeric ty, PGTyped ty)