From 07be99363156b2d1011954be7b5a4cc8f33b256b Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 18 Feb 2022 00:02:39 +0800 Subject: Fixed parsing decimal precision issue --- cell_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cell_test.go') diff --git a/cell_test.go b/cell_test.go index f6f1098..92d3d2f 100644 --- a/cell_test.go +++ b/cell_test.go @@ -130,7 +130,7 @@ func TestSetCellFloat(t *testing.T) { assert.Equal(t, "123", val, "A1 should be 123") val, err = f.GetCellValue(sheet, "A2") assert.NoError(t, err) - assert.Equal(t, "123.0", val, "A2 should be 123.0") + assert.Equal(t, "123", val, "A2 should be 123") }) t.Run("with a decimal and precision limit", func(t *testing.T) { @@ -288,12 +288,14 @@ func TestGetCellValue(t *testing.T) { 275.39999999999998 68.900000000000006 8.8880000000000001E-2 - 4.0000000000000003E-5 + 4.0000000000000003e-5 2422.3000000000002 1101.5999999999999 275.39999999999998 68.900000000000006 1.1000000000000001 + 1234567890123_4 + 123456789_0123_4 `))) f.checked = nil rows, err = f.GetRows("Sheet1") @@ -325,6 +327,8 @@ func TestGetCellValue(t *testing.T) { "275.4", "68.9", "1.1", + "1234567890123_4", + "123456789_0123_4", }}, rows) assert.NoError(t, err) } -- cgit v1.2.1