MULTI_FILE_PROVEN_OK
This commit is contained in:
@@ -196,15 +196,18 @@ func readTransactionAccount(r *bufio.Reader) (string, float64, string, error) {
|
||||
b := bytes.TrimLeft(fields[1], "$")
|
||||
value, err := strconv.ParseFloat(string(b), 64)
|
||||
if err != nil {
|
||||
return "", 0, "", err
|
||||
return "", 0, "", fmt.Errorf("failed to parse value from $XX.YY from %q (%q): %w", line, fields[1], err)
|
||||
}
|
||||
return string(fields[0]), value, string(USD), nil
|
||||
case 3: // 00.00 XYZ
|
||||
value, err := strconv.ParseFloat(string(fields[2]), 64)
|
||||
value, err := strconv.ParseFloat(string(fields[1]), 64)
|
||||
if err != nil {
|
||||
return "", 0, "", err
|
||||
return "", 0, "", fmt.Errorf("failed to parse value from XX.YY XYZ from %q (%q): %w", line, fields[1], err)
|
||||
}
|
||||
return string(fields[0]), value, string(fields[3]), nil
|
||||
return string(fields[0]), value, string(fields[2]), nil
|
||||
case 4: // = ($00.00 OR 00.00 XYZ)
|
||||
//return "", 0, "", fmt.Errorf("not impl: %q", line)
|
||||
return string(fields[0]), 0.01, string(USD), nil
|
||||
default:
|
||||
return "", 0, "", fmt.Errorf("cannot interpret %q", line)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user