From 14ebde52893263930cdcde1406cc91cc5c42556f Mon Sep 17 00:00:00 2001 From: Christian Theune Date: Tue, 5 Jan 2016 00:40:40 +0100 Subject: First hit at providing support for floats in the language. --- src/nix-env/nix-env.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nix-env') diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 02a9f25a7a4e..dcfb8f35324a 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -1127,6 +1127,10 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) attrs2["type"] = "int"; attrs2["value"] = (format("%1%") % v->integer).str(); xml.writeEmptyElement("meta", attrs2); + } else if (v->type == tFloat) { + attrs2["type"] = "float"; + attrs2["value"] = (format("%1%") % v->fpoint).str(); + xml.writeEmptyElement("meta", attrs2); } else if (v->type == tBool) { attrs2["type"] = "bool"; attrs2["value"] = v->boolean ? "true" : "false"; -- cgit 1.4.1