fix: treat VS as a string on read and write
Go stringified sheet cells with fmt.Sprint, so a numeric VS read with UNFORMATTED_VALUE was rendered as 2.609767878e+09. Text columns of the payments sheet now go through sheets.CellString, which never uses exponent form; bank inference uses the same helper. Both sync implementations now append VS as a text cell so Sheets keeps it a string and leading zeros survive. Existing rows are not rewritten. Python already read VS as a digit string; a regression test pins that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,10 @@ func TestSyncToSheets_EmptySheet(t *testing.T) {
|
||||
if syncID, ok := rows[0][10].(string); !ok || len(syncID) != 64 {
|
||||
t.Errorf("expected 64-char hex sync ID, got %v", rows[0][10])
|
||||
}
|
||||
// VS (index 7) is written as text so Sheets keeps it a string.
|
||||
if vs, _ := rows[0][7].(string); vs != "'123" {
|
||||
t.Errorf("expected VS written as text cell '123, got %v", rows[0][7])
|
||||
}
|
||||
}
|
||||
|
||||
func TestSyncToSheets_Dedup(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user