If a boolean value is to an amount, use 1 or 0

This commit is contained in:
John Wiegley 2009-02-15 19:25:43 -04:00
parent dfee8bc691
commit 6bfb4206b1

View file

@ -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;