From 6bfb4206b15f7b0b9ecef785ee5e01b63142dcf7 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 15 Feb 2009 19:25:43 -0400 Subject: [PATCH] If a boolean value is to an amount, use 1 or 0 --- src/value.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/value.cc b/src/value.cc index 9eb5b2e1..9a7647e1 100644 --- a/src/value.cc +++ b/src/value.cc @@ -851,6 +851,9 @@ void value_t::in_place_cast(type_t cast_type) switch (type()) { case BOOLEAN: switch (cast_type) { + case AMOUNT: + set_amount(as_boolean() ? 1L : 0L); + return; case STRING: set_string(as_boolean() ? "true" : "false"); return;