refund: `Dollar::from_float` use the autoinit constructor
authorJean Privat <jean@pryen.org>
Mon, 13 Jul 2015 20:04:51 +0000 (16:04 -0400)
committerJean Privat <jean@pryen.org>
Mon, 13 Jul 2015 20:04:51 +0000 (16:04 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

contrib/refund/src/refund_base.nit

index fbd5fee..ec1de5a 100644 (file)
@@ -402,7 +402,7 @@ class Dollar
 
        # Inits `self` from a float `value`.
        init from_float(value: Float) do
-               self.value = (value * 100.0).to_i
+               init((value * 100.0).to_i)
        end
 
        redef fun to_s do return "{value / 100}.{value % 100}$"