Skip to content

Commit 209e957

Browse files
joshdayvisr
authored andcommitted
hotfix for minimum float value
1 parent 2d17cb6 commit 209e957

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DBFTables.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ dbf_value(::Val{'L'}, ::UInt8, ::Missing) = '?'
9898

9999
# Integer & AbstractFloat
100100
function dbf_value(::Val{'N'}, ::UInt8, x::Union{AbstractFloat, Integer})
101+
minval = -9999999999999999999
101102
maxval = 99999999999999999999
102-
abs(x) > maxval && @warn "Due to DBF limitations, a float will be clamped to fit in 20 characters."
103-
rpad(clamp(x, -maxval, maxval), 20)
103+
minval x maxval && @warn "Due to DBF limitations, a float will be clamped to fit in 20 characters."
104+
rpad(clamp(x, minval, maxval), 20)
104105
end
105106
dbf_value(::Val{'N'}, ::UInt8, ::Missing) = ' ' ^ 20
106107

0 commit comments

Comments
 (0)