summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-07-25 20:57:28 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:16 -0400
commitd65a758c8428403ece6548955a206a4b18a577b2 (patch)
tree335c5f981ef240444580d0ee16ef331bd0a129e7 /amount.cc
parent312f0c27e397d3138e582818d05c21e9f999c9fe (diff)
downloadfork-ledger-d65a758c8428403ece6548955a206a4b18a577b2.tar.gz
fork-ledger-d65a758c8428403ece6548955a206a4b18a577b2.tar.bz2
fork-ledger-d65a758c8428403ece6548955a206a4b18a577b2.zip
Moved the setting of time quantities to the commodity initialization
section.
Diffstat (limited to 'amount.cc')
-rw-r--r--amount.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/amount.cc b/amount.cc
index 0af18a7b..933716c6 100644
--- a/amount.cc
+++ b/amount.cc
@@ -60,6 +60,26 @@ static struct _init_amounts {
commodity_t::updater = NULL;
commodity_t::null_commodity = commodity_t::find_commodity("", true);
commodity_t::default_commodity = NULL;
+
+ // Add time commodity conversions, so that timelog's may be parsed
+ // in terms of seconds, but reported as minutes or hours.
+ commodity_t * commodity;
+
+ commodity = commodity_t::find_commodity("s", true);
+ commodity->flags |= COMMODITY_STYLE_NOMARKET;
+
+ parse_conversion("1.0m", "60s");
+ parse_conversion("1.0h", "60m");
+
+#if 0
+ commodity = commodity_t::find_commodity("b", true);
+ commodity->flags |= COMMODITY_STYLE_NOMARKET;
+
+ parse_conversion("1.00 Kb", "1024 b");
+ parse_conversion("1.00 Mb", "1024 Kb");
+ parse_conversion("1.00 Gb", "1024 Mb");
+ parse_conversion("1.00 Tb", "1024 Gb");
+#endif
}
~_init_amounts() {