From 077aaf3468c640b84ff53fc92171292ddae55bf4 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Mon, 22 Apr 2019 22:33:15 +0000 Subject: Int and float modules --- src/float.gleam | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/float.gleam (limited to 'src/float.gleam') diff --git a/src/float.gleam b/src/float.gleam new file mode 100644 index 0000000..2d3ca3c --- /dev/null +++ b/src/float.gleam @@ -0,0 +1,13 @@ +import iodata + +pub enum NotAFloat = + | NotAFloat + +pub external fn parse(String) -> Result(Float, NotAFloat) = + "gleam__stdlib" "parse_float"; + +pub fn to_string(f) { + f + |> iodata:from_float + |> iodata:to_string +} -- cgit v1.2.3