on dev help sign in
decimal point
91cb791Eitan Chatav
squeel-postgresql/src/Squeel/PostgreSQL/Statement.hs+3−3
@@ -133,15 +133,15 @@ instance PGNum ty
133 (*) = unsafeBinaryOp "*"
133 (*) = unsafeBinaryOp "*"
134 abs = unsafeFunction "abs"
134 abs = unsafeFunction "abs"
135 signum = unsafeFunction "sign"
135 signum = unsafeFunction "sign"
136− fromInteger = UnsafeExpression . fromString . show
136+ fromInteger = UnsafeExpression . (<> ".") . fromString . show
137
137
138instance PGFractional ty
138instance PGFractional ty
139 => Fractional (Expression params tables ('Required (nullity ty))) where
139 => Fractional (Expression params tables ('Required (nullity ty))) where
140 (/) = unsafeBinaryOp "/"
140 (/) = unsafeBinaryOp "/"
141 fromRational x = UnsafeExpression $ mconcat
141 fromRational x = UnsafeExpression $ mconcat
142− [ fromString (show (numerator x))
142+ [ fromString (show (numerator x)) <> "."
143 , "/"
143 , "/"
144− , fromString (show (denominator x))
144+ , fromString (show (denominator x)) <> "."
145 ]
145 ]
146
146
147instance (PGFloating ty, PGCast 'PGNumeric ty, PGTyped ty)
147instance (PGFloating ty, PGCast 'PGNumeric ty, PGTyped ty)