Skip to content

Commit c8d8503

Browse files
committed
Fix divide-by-zero in CSV update
1 parent 0651b69 commit c8d8503

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## Getting Started
99
Download the latest [msmquote JAR](https://github.com/36bits/msmquote/releases) to your machine and run it from the command line as follows:
1010

11-
`java -cp msmquote-3.1.0.jar uk.co.pueblo.msmquote.Update moneyfile.mny password source`
11+
`java -cp msmquote-3.1.2.jar uk.co.pueblo.msmquote.Update moneyfile.mny password source`
1212

1313
Parameters:
1414
* **moneyfile.mny** is the Microsoft Money file you wish to update
@@ -47,7 +47,7 @@ The **source** parameter can be set to retrieve and update quote data from one o
4747

4848
Update historical quote data for a single investment using a CSV file generated by the Yahoo Finance historical prices download facility. The CSV filename must be in the format `symbol_currency_quotetype.csv`, where:
4949
- `symbol` matches the symbol in your Money file that you wish to update
50-
- `currency` is the currency of the quote data, for example 'GBp'
50+
- `currency` is the three-character Yahoo Finance currency code of the quote data, for example 'GBp'
5151
- `quotetype` is the quote type, currently one of `EQUITY`, `BOND`, `INDEX` or `MUTUALFUND`.
5252

5353
For example, the following source parameter will update quote data for Tesco PLC (symbol TSCO.L) from a CSV file containing quote values in British pence:

Release Notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Version 3.1.2
2+
3+
## Bug Fixes
4+
* Fix divide-by-zero in CSV update.
5+
16
# Version 3.1.1
27

38
## Changes

src/main/java/uk/co/pueblo/msmquote/source/YahooCsvHist.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
import java.io.FileReader;
66
import java.io.IOException;
77
import java.io.InputStream;
8-
import java.time.Instant;
9-
import java.time.LocalDate;
108
import java.time.LocalDateTime;
119
import java.time.ZoneId;
12-
import java.time.format.DateTimeFormatter;
1310
import java.util.HashMap;
1411
import java.util.Map;
1512
import java.util.Properties;
@@ -65,6 +62,7 @@ public YahooCsvHist(String fileName) throws IOException {
6562
symbol = quoteMeta[0];
6663

6764
// Set quote divisor according to currency
65+
quoteDivisor = 1;
6866
String quoteDivisorProp = baseProps.getProperty("divisor." + quoteMeta[1] + "." + quoteMeta[2]);
6967
if (quoteDivisorProp != null) {
7068
quoteDivisor = Integer.parseInt(quoteDivisorProp);

0 commit comments

Comments
 (0)