document scientific notation (#704, #706)

This commit is contained in:
Simon Michael 2018-03-31 02:41:31 +01:00
parent c95982381b
commit 571ea1540b
4 changed files with 84 additions and 61 deletions

View File

@ -369,6 +369,17 @@ Some examples:
.P .P
.PD .PD
\f[C]1\ 999\ 999.9455\f[] \f[C]1\ 999\ 999.9455\f[]
.PD 0
.P
.PD
\f[C]EUR\ 1E3\ \ \ #\ 1000\ euros\f[]
.PD 0
.P
.PD
\f[C]1000E\-6s\ \ #\ 1000\ microseconds\f[]
.PD 0
.P
.PD
.PP .PP
As you can see, the amount format is somewhat flexible: As you can see, the amount format is somewhat flexible:
.IP \[bu] 2 .IP \[bu] 2
@ -389,6 +400,8 @@ groups
.IP \[bu] 2 .IP \[bu] 2
decimal part can be separated by comma or period and should be different decimal part can be separated by comma or period and should be different
from digit groups separator from digit groups separator
.IP \[bu] 2
scientific E\-notation (without digit groups) is allowed
.PP .PP
You can use any of these variations when recording data. You can use any of these variations when recording data.
However, there is some ambiguous way of representing numbers like However, there is some ambiguous way of representing numbers like

View File

@ -349,6 +349,8 @@ commodity name. Some examples:
'INR 9,99,99,999.00' 'INR 9,99,99,999.00'
'EUR -2.000.000,00' 'EUR -2.000.000,00'
'1 999 999.9455' '1 999 999.9455'
'EUR 1E3 # 1000 euros'
'1000E-6s # 1000 microseconds'
As you can see, the amount format is somewhat flexible: As you can see, the amount format is somewhat flexible:
@ -365,6 +367,7 @@ commodity name. Some examples:
all groups all groups
* decimal part can be separated by comma or period and should be * decimal part can be separated by comma or period and should be
different from digit groups separator different from digit groups separator
* scientific E-notation (without digit groups) is allowed
You can use any of these variations when recording data. However, You can use any of these variations when recording data. However,
there is some ambiguous way of representing numbers like '$1.000' and there is some ambiguous way of representing numbers like '$1.000' and
@ -1199,65 +1202,65 @@ Node: Account names11239
Ref: #account-names11382 Ref: #account-names11382
Node: Amounts11869 Node: Amounts11869
Ref: #amounts12005 Ref: #amounts12005
Node: Virtual Postings14685 Node: Virtual Postings14800
Ref: #virtual-postings14844 Ref: #virtual-postings14959
Node: Balance Assertions16064 Node: Balance Assertions16179
Ref: #balance-assertions16239 Ref: #balance-assertions16354
Node: Assertions and ordering17135 Node: Assertions and ordering17250
Ref: #assertions-and-ordering17321 Ref: #assertions-and-ordering17436
Node: Assertions and included files18021 Node: Assertions and included files18136
Ref: #assertions-and-included-files18262 Ref: #assertions-and-included-files18377
Node: Assertions and multiple -f options18595 Node: Assertions and multiple -f options18710
Ref: #assertions-and-multiple--f-options18849 Ref: #assertions-and-multiple--f-options18964
Node: Assertions and commodities18981 Node: Assertions and commodities19096
Ref: #assertions-and-commodities19216 Ref: #assertions-and-commodities19331
Node: Assertions and subaccounts19912 Node: Assertions and subaccounts20027
Ref: #assertions-and-subaccounts20144 Ref: #assertions-and-subaccounts20259
Node: Assertions and virtual postings20665 Node: Assertions and virtual postings20780
Ref: #assertions-and-virtual-postings20872 Ref: #assertions-and-virtual-postings20987
Node: Balance Assignments21014 Node: Balance Assignments21129
Ref: #balance-assignments21183 Ref: #balance-assignments21298
Node: Prices22303 Node: Prices22418
Ref: #prices22436 Ref: #prices22551
Node: Transaction prices22487 Node: Transaction prices22602
Ref: #transaction-prices22632 Ref: #transaction-prices22747
Node: Market prices24788 Node: Market prices24903
Ref: #market-prices24923 Ref: #market-prices25038
Node: Comments25883 Node: Comments25998
Ref: #comments26005 Ref: #comments26120
Node: Tags27247 Node: Tags27362
Ref: #tags27365 Ref: #tags27480
Node: Directives28767 Node: Directives28882
Ref: #directives28880 Ref: #directives28995
Node: Account aliases29073 Node: Account aliases29188
Ref: #account-aliases29217 Ref: #account-aliases29332
Node: Basic aliases29821 Node: Basic aliases29936
Ref: #basic-aliases29964 Ref: #basic-aliases30079
Node: Regex aliases30654 Node: Regex aliases30769
Ref: #regex-aliases30822 Ref: #regex-aliases30937
Node: Multiple aliases31540 Node: Multiple aliases31655
Ref: #multiple-aliases31712 Ref: #multiple-aliases31827
Node: end aliases32210 Node: end aliases32325
Ref: #end-aliases32350 Ref: #end-aliases32465
Node: account directive32451 Node: account directive32566
Ref: #account-directive32631 Ref: #account-directive32746
Node: apply account directive33978 Node: apply account directive34093
Ref: #apply-account-directive34174 Ref: #apply-account-directive34289
Node: Multi-line comments34833 Node: Multi-line comments34948
Ref: #multi-line-comments35023 Ref: #multi-line-comments35138
Node: commodity directive35151 Node: commodity directive35266
Ref: #commodity-directive35335 Ref: #commodity-directive35450
Node: Default commodity36207 Node: Default commodity36322
Ref: #default-commodity36380 Ref: #default-commodity36495
Node: Default year36917 Node: Default year37032
Ref: #default-year37082 Ref: #default-year37197
Node: Including other files37505 Node: Including other files37620
Ref: #including-other-files37662 Ref: #including-other-files37777
Node: Periodic transactions38059 Node: Periodic transactions38174
Ref: #periodic-transactions38225 Ref: #periodic-transactions38340
Node: Automated postings39214 Node: Automated postings39329
Ref: #automated-postings39377 Ref: #automated-postings39492
Node: EDITOR SUPPORT40279 Node: EDITOR SUPPORT40394
Ref: #editor-support40404 Ref: #editor-support40519
 
End Tag Table End Tag Table

View File

@ -268,7 +268,9 @@ Amounts consist of a number and (usually) a currency symbol or commodity name. S
`-$1,000,000.00`\ `-$1,000,000.00`\
`INR 9,99,99,999.00`\ `INR 9,99,99,999.00`\
`EUR -2.000.000,00`\ `EUR -2.000.000,00`\
`1 999 999.9455` `1 999 999.9455`\
`EUR 1E3 # 1000 euros`\
`1000E-6s # 1000 microseconds`\
As you can see, the amount format is somewhat flexible: As you can see, the amount format is somewhat flexible:
@ -278,6 +280,7 @@ As you can see, the amount format is somewhat flexible:
- negative amounts with a commodity on the left can have the minus sign before or after it - negative amounts with a commodity on the left can have the minus sign before or after it
- digit groups (thousands, or any other grouping) can be separated by space or comma or period and should be used as separator between all groups - digit groups (thousands, or any other grouping) can be separated by space or comma or period and should be used as separator between all groups
- decimal part can be separated by comma or period and should be different from digit groups separator - decimal part can be separated by comma or period and should be different from digit groups separator
- scientific E-notation (without digit groups) is allowed
You can use any of these variations when recording data. However, there is some ambiguous way of representing numbers like `$1.000` and `$1,000` both may mean either one thousand or one dollar. By default hledger will assume that this is sole delimiter is used only for decimals. On the other hand commodity format declared prior to that line will help to resolve that ambiguity differently: You can use any of these variations when recording data. However, there is some ambiguous way of representing numbers like `$1.000` and `$1,000` both may mean either one thousand or one dollar. By default hledger will assume that this is sole delimiter is used only for decimals. On the other hand commodity format declared prior to that line will help to resolve that ambiguity differently:

View File

@ -261,6 +261,8 @@ FILE FORMAT
INR 9,99,99,999.00 INR 9,99,99,999.00
EUR -2.000.000,00 EUR -2.000.000,00
1 999 999.9455 1 999 999.9455
EUR 1E3 # 1000 euros
1000E-6s # 1000 microseconds
As you can see, the amount format is somewhat flexible: As you can see, the amount format is somewhat flexible:
@ -282,6 +284,8 @@ FILE FORMAT
o decimal part can be separated by comma or period and should be dif- o decimal part can be separated by comma or period and should be dif-
ferent from digit groups separator ferent from digit groups separator
o scientific E-notation (without digit groups) is allowed
You can use any of these variations when recording data. However, You can use any of these variations when recording data. However,
there is some ambiguous way of representing numbers like $1.000 and there is some ambiguous way of representing numbers like $1.000 and
$1,000 both may mean either one thousand or one dollar. By default $1,000 both may mean either one thousand or one dollar. By default