support importing amounts that use non-breaking space (NBSP), narrow no-break space (NNBSP) or figure space as digit grouping symbol when importing delimiter-separated values file / data (#361)

This commit is contained in:
MaysWind
2025-11-26 23:57:54 +08:00
parent 4781cb34eb
commit 2c454f001e
3 changed files with 64 additions and 2 deletions
@@ -215,6 +215,12 @@ func (t *customPlainTextDataRowIterator) parseTransaction(ctx core.Context, user
func (t *customPlainTextDataRowIterator) parseAmount(ctx core.Context, amountValue string) (string, error) {
if t.transactionDataTable.amountDigitGroupingSymbol != "" {
amountValue = strings.ReplaceAll(amountValue, t.transactionDataTable.amountDigitGroupingSymbol, "")
if t.transactionDataTable.amountDigitGroupingSymbol == " " {
amountValue = strings.ReplaceAll(amountValue, "\u00A0", "") // No-Break Space (NBSP)
amountValue = strings.ReplaceAll(amountValue, "\u202F", "") // Narrow No-Break Space (NNBSP)
amountValue = strings.ReplaceAll(amountValue, "\u2007", "") // Figure Space
}
}
if t.transactionDataTable.amountDecimalSeparator != "" && t.transactionDataTable.amountDecimalSeparator != "." {