Commit eda6a12
fix: TOML parsing of fractional seconds (#59999)
fix a bug in which parsing the digits after the decimal point of a
(date-)time like "00:00:00.12" were interpreted as "12 milliseconds"
instead of "0.12 seconds". Now, the fractional part is correctly parsed
as a fraction of a second, then correctly converted to milliseconds. As
before, only the first three digits after the decimal point are
considered.
Closes #59997
---
With a local build of this PR, the example from the above issue now
evaluates to:
```julia
julia> t2 = TOML.parse("""time = 00:00:00.2""")
Dict{String, Any} with 1 entry:
"time" => 00:00:00.2
julia> millisecond(t2["time"])
200
```
(cherry picked from commit 906d64e)1 parent edf9fa7 commit eda6a12
2 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
1113 | | - | |
| 1113 | + | |
1114 | 1114 | | |
1115 | 1115 | | |
1116 | 1116 | | |
| |||
1121 | 1121 | | |
1122 | 1122 | | |
1123 | 1123 | | |
1124 | | - | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1125 | 1127 | | |
| 1128 | + | |
1126 | 1129 | | |
1127 | 1130 | | |
1128 | 1131 | | |
1129 | | - | |
| 1132 | + | |
1130 | 1133 | | |
1131 | 1134 | | |
1132 | 1135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
| |||
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
135 | | - | |
| 138 | + | |
136 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
| |||
0 commit comments