timelog: show hours with 2 decimal places, not 1
This commit is contained in:
		
							parent
							
								
									099a1de3b6
								
							
						
					
					
						commit
						592ae9a28e
					
				| @ -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: | appropriate amount of hours. From the time log above, hledger print gives: | ||||||
| 
 | 
 | ||||||
|     2009/03/31 * 22:21-23:59 |     2009/03/31 * 22:21-23:59 | ||||||
|         (projects:A)          1.6h |         (projects:A)         1.64h | ||||||
|      |      | ||||||
|     2009/04/01 * 00:00-02:00 |     2009/04/01 * 00:00-02:00 | ||||||
|         (projects:A)          2.0h |         (projects:A)         2.01h | ||||||
| 
 | 
 | ||||||
| Here is a | Here is a | ||||||
| [sample.timelog](https://raw.github.com/simonmichael/hledger/master/data/sample.timelog) to | [sample.timelog](https://raw.github.com/simonmichael/hledger/master/data/sample.timelog) to | ||||||
|  | |||||||
| @ -155,10 +155,10 @@ missingamt = amount{acommodity="AUTO"} | |||||||
| -- Handy amount constructors for tests. | -- Handy amount constructors for tests. | ||||||
| -- usd/eur/gbp round their argument to a whole number of pennies/cents. | -- usd/eur/gbp round their argument to a whole number of pennies/cents. | ||||||
| num n = amount{acommodity="",  aquantity=n} | 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}} | usd n = amount{acommodity="$", aquantity=roundTo 2 n, astyle=amountstyle{asprecision=2}} | ||||||
| eur 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}} | 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 `at` priceamt = amt{aprice=UnitPrice priceamt} | ||||||
| amt @@ priceamt = amt{aprice=TotalPrice priceamt} | amt @@ priceamt = amt{aprice=TotalPrice priceamt} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -122,7 +122,7 @@ tests_showTransactionUnelided = [ | |||||||
|       "2012/05/14=2012/05/15 (code) desc    ; tcomment1", |       "2012/05/14=2012/05/15 (code) desc    ; tcomment1", | ||||||
|       "    ; tcomment2", |       "    ; tcomment2", | ||||||
|       "                $1.00", |       "                $1.00", | ||||||
|       "    * a          2.0h", |       "    * a         2.00h", | ||||||
|       "    ; pcomment2", |       "    ; pcomment2", | ||||||
|       "" |       "" | ||||||
|       ] |       ] | ||||||
| @ -203,7 +203,7 @@ tests_postingAsLines = [ | |||||||
|       } |       } | ||||||
|      `gives` [ |      `gives` [ | ||||||
|       "                $1.00", |       "                $1.00", | ||||||
|       "    * a          2.0h    ; pcomment1", |       "    * a         2.00h    ; pcomment1", | ||||||
|       "    ; pcomment2", |       "    ; pcomment2", | ||||||
|       "    ;   tag3: val3  " |       "    ;   tag3: val3  " | ||||||
|       ] |       ] | ||||||
|  | |||||||
| @ -132,7 +132,7 @@ tests_Hledger_Cli = TestList | |||||||
| 
 | 
 | ||||||
|   ,"show dollars" ~: showAmount (usd 1) ~?= "$1.00" |   ,"show dollars" ~: showAmount (usd 1) ~?= "$1.00" | ||||||
| 
 | 
 | ||||||
|   ,"show hours" ~: showAmount (hrs 1) ~?= "1.0h" |   ,"show hours" ~: showAmount (hrs 1) ~?= "1.00h" | ||||||
| 
 | 
 | ||||||
|  ] |  ] | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ o 2009/1/1 09:00:00 | |||||||
| 
 | 
 | ||||||
| >>> | >>> | ||||||
| 2009/01/01 * 08:00-09:00 | 2009/01/01 * 08:00-09:00 | ||||||
|     (something)          1.0h |     (something)         1.00h | ||||||
| 
 | 
 | ||||||
| >>>2 | >>>2 | ||||||
| >>>= 0 | >>>= 0 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user