Skip to content

Commit a6f550f

Browse files
committed
Write all amounts with the same format when exporting to QIF
We were writing some amounts with locale-less format and others with user's locale. That make GnuCash desktop fail to import. Now we always use the locale-less format. GnuCash always accepts them, independently of the user's locale. Fixes #655
1 parent 3c71be7 commit a6f550f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/src/main/java/org/gnucash/android/export/qif/QifExporter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
import java.io.OutputStreamWriter;
3939
import java.math.BigDecimal;
4040
import java.util.ArrayList;
41-
import java.util.Currency;
4241
import java.util.List;
42+
import java.util.Locale;
4343

4444
import static org.gnucash.android.db.DatabaseSchema.AccountEntry;
4545
import static org.gnucash.android.db.DatabaseSchema.SplitEntry;
@@ -210,9 +210,10 @@ public List<String> generateExport() throws ExporterException {
210210
if (quantity_denom != 0) {
211211
quantity = quantity_num / quantity_denom;
212212
}
213+
final Locale noLocale = null;
213214
writer.append(QifHelper.SPLIT_AMOUNT_PREFIX)
214215
.append(splitType.equals("DEBIT") ? "-" : "")
215-
.append(String.format("%." + precision + "f", quantity))
216+
.append(String.format(noLocale, "%." + precision + "f", quantity))
216217
.append(newLine);
217218
}
218219
if (!currentTransactionUID.equals("")) {

0 commit comments

Comments
 (0)