timelog: show hours with 2 decimal places, not 1

This commit is contained in:
Simon Michael 2015-02-27 05:27:24 -08:00
parent 099a1de3b6
commit 592ae9a28e
5 changed files with 7 additions and 7 deletions

View File

@ -736,10 +736,10 @@ and creates a virtual transaction (or several - one per day) with the
appropriate amount of hours. From the time log above, hledger print gives:
2009/03/31 * 22:21-23:59
(projects:A) 1.6h
(projects:A) 1.64h
2009/04/01 * 00:00-02:00
(projects:A) 2.0h
(projects:A) 2.01h
Here is a
[sample.timelog](https://raw.github.com/simonmichael/hledger/master/data/sample.timelog) to

View File

@ -155,10 +155,10 @@ missingamt = amount{acommodity="AUTO"}
-- Handy amount constructors for tests.
-- usd/eur/gbp round their argument to a whole number of pennies/cents.
num n = amount{acommodity="", aquantity=n}
hrs n = amount{acommodity="h", aquantity=n, astyle=amountstyle{asprecision=2, ascommodityside=R}}
usd n = amount{acommodity="$", aquantity=roundTo 2 n, astyle=amountstyle{asprecision=2}}
eur n = amount{acommodity="", aquantity=roundTo 2 n, astyle=amountstyle{asprecision=2}}
gbp n = amount{acommodity="£", aquantity=roundTo 2 n, astyle=amountstyle{asprecision=2}}
hrs n = amount{acommodity="h", aquantity=roundTo 1 n, astyle=amountstyle{asprecision=1, ascommodityside=R}}
amt `at` priceamt = amt{aprice=UnitPrice priceamt}
amt @@ priceamt = amt{aprice=TotalPrice priceamt}

View File

@ -122,7 +122,7 @@ tests_showTransactionUnelided = [
"2012/05/14=2012/05/15 (code) desc ; tcomment1",
" ; tcomment2",
" $1.00",
" * a 2.0h",
" * a 2.00h",
" ; pcomment2",
""
]
@ -203,7 +203,7 @@ tests_postingAsLines = [
}
`gives` [
" $1.00",
" * a 2.0h ; pcomment1",
" * a 2.00h ; pcomment1",
" ; pcomment2",
" ; tag3: val3 "
]

View File

@ -132,7 +132,7 @@ tests_Hledger_Cli = TestList
,"show dollars" ~: showAmount (usd 1) ~?= "$1.00"
,"show hours" ~: showAmount (hrs 1) ~?= "1.0h"
,"show hours" ~: showAmount (hrs 1) ~?= "1.00h"
]

View File

@ -6,7 +6,7 @@ o 2009/1/1 09:00:00
>>>
2009/01/01 * 08:00-09:00
(something) 1.0h
(something) 1.00h
>>>2
>>>= 0