diff options
author | Christian Theune <ct@flyingcircus.io> | 2016-01-04T23·40+0100 |
---|---|---|
committer | Christian Theune <ct@flyingcircus.io> | 2016-01-04T23·40+0100 |
commit | 14ebde52893263930cdcde1406cc91cc5c42556f (patch) | |
tree | 2b65c11405f9aef33eb284208716f9cb5b434599 /src/nix-env/nix-env.cc | |
parent | b8258a4475726b56a4caa6553568c67a343a091d (diff) |
First hit at providing support for floats in the language.
Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r-- | src/nix-env/nix-env.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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"; |