summaryrefslogtreecommitdiff
path: root/src/amount.cc
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-09-20 07:26:44 -0700
committerCraig Earls <enderw88@gmail.com>2013-09-20 07:26:44 -0700
commitbee6605e084777261f1536e4e65f76bb94eca06c (patch)
tree678bddcb8dc8bfd87d352084c3dece144a0974ed /src/amount.cc
parent9f3afc26f5e7863ed8beac3a411dab8becc7bff9 (diff)
parentd30c3fb869b8c4f7740eefec573fadedbe21b7d1 (diff)
downloadfork-ledger-bee6605e084777261f1536e4e65f76bb94eca06c.tar.gz
fork-ledger-bee6605e084777261f1536e4e65f76bb94eca06c.tar.bz2
fork-ledger-bee6605e084777261f1536e4e65f76bb94eca06c.zip
Merge branch 'master' into ledger-mode-automatic-transactions
Diffstat (limited to 'src/amount.cc')
-rw-r--r--src/amount.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/amount.cc b/src/amount.cc
index 4fe73546..6ff2f4dd 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -196,8 +196,8 @@ namespace {
for (const char * p = buf; *p; p++) {
if (*p == '.') {
- if (commodity_t::time_colon_by_default ||
- (comm && comm->has_flags(COMMODITY_STYLE_TIME_COLON)))
+ if (("h" == comm->symbol() || "m" == comm->symbol()) && (commodity_t::time_colon_by_default ||
+ (comm && comm->has_flags(COMMODITY_STYLE_TIME_COLON))))
out << ':';
else if (commodity_t::decimal_comma_by_default ||
(comm && comm->has_flags(COMMODITY_STYLE_DECIMAL_COMMA)))
@@ -213,8 +213,8 @@ namespace {
out << *p;
if (integer_digits > 3 && --integer_digits % 3 == 0) {
- if (commodity_t::time_colon_by_default ||
- (comm && comm->has_flags(COMMODITY_STYLE_TIME_COLON)))
+ if (("h" == comm->symbol() || "m" == comm->symbol()) && (commodity_t::time_colon_by_default ||
+ (comm && comm->has_flags(COMMODITY_STYLE_TIME_COLON))))
out << ':';
else if (commodity_t::decimal_comma_by_default ||
(comm && comm->has_flags(COMMODITY_STYLE_DECIMAL_COMMA)))
@@ -744,7 +744,7 @@ void amount_t::in_place_unreduce()
}
if (shifted) {
- if ("h" == comm->symbol() && commodity_t::time_colon_by_default) {
+ if (("h" == comm->symbol() || "m" == comm->symbol()) && commodity_t::time_colon_by_default) {
amount_t floored = tmp.floored();
amount_t precision = tmp - floored;
if (precision < 0.0) {