mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
Fix mlr -O to return strings for all octal numbers along with 0* numbers like 07 and 08 (#766)
This commit is contained in:
parent
d22cd2012a
commit
7642f7ede6
6 changed files with 21 additions and 1 deletions
|
|
@ -159,7 +159,7 @@ func inferNormally(input string, inferBool bool) *Mlrval {
|
|||
|
||||
func inferWithOctalSuppress(input string, inferBool bool) *Mlrval {
|
||||
output := inferNormally(input, inferBool)
|
||||
if output.mvtype != MT_INT {
|
||||
if output.mvtype != MT_INT && output.mvtype != MT_FLOAT {
|
||||
return output
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ x t y z
|
|||
123 float 124 123.5
|
||||
123.45 float 124.45 123.95
|
||||
0123 float 84 83.5
|
||||
07 float 8 7.5
|
||||
08 float 9 8.5
|
||||
0b0100 float 5 4.5
|
||||
0x1000 float 4097 4096.5
|
||||
-123 float -122 -122.5
|
||||
|
|
@ -9,3 +11,5 @@ x t y z
|
|||
-0123 float -82 -82.5
|
||||
-0b0100 float -3 -3.5
|
||||
-0x1000 float -4095 -4095.5
|
||||
-07 float -6 -6.5
|
||||
-08 float -7 -7.5
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ x t y z
|
|||
123 int 124 123.5
|
||||
123.45 float 124.45 123.95
|
||||
0123 string (error) (error)
|
||||
07 string (error) (error)
|
||||
08 string (error) (error)
|
||||
0b0100 int 5 4.5
|
||||
0x1000 int 4097 4096.5
|
||||
-123 int -122 -122.5
|
||||
|
|
@ -9,3 +11,5 @@ x t y z
|
|||
-0123 string (error) (error)
|
||||
-0b0100 int -3 -3.5
|
||||
-0x1000 int -4095 -4095.5
|
||||
-07 string (error) (error)
|
||||
-08 string (error) (error)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ x t y z
|
|||
123 string (error) (error)
|
||||
123.45 string (error) (error)
|
||||
0123 string (error) (error)
|
||||
07 string (error) (error)
|
||||
08 string (error) (error)
|
||||
0b0100 string (error) (error)
|
||||
0x1000 string (error) (error)
|
||||
-123 string (error) (error)
|
||||
|
|
@ -9,3 +11,5 @@ x t y z
|
|||
-0123 string (error) (error)
|
||||
-0b0100 string (error) (error)
|
||||
-0x1000 string (error) (error)
|
||||
-07 string (error) (error)
|
||||
-08 string (error) (error)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ x t y z
|
|||
123 int 124 123.5
|
||||
123.45 float 124.45 123.95
|
||||
0123 int 84 83.5
|
||||
07 int 8 7.5
|
||||
08 float 9 8.5
|
||||
0b0100 int 5 4.5
|
||||
0x1000 int 4097 4096.5
|
||||
-123 int -122 -122.5
|
||||
|
|
@ -9,3 +11,5 @@ x t y z
|
|||
-0123 int -82 -82.5
|
||||
-0b0100 int -3 -3.5
|
||||
-0x1000 int -4095 -4095.5
|
||||
-07 int -6 -6.5
|
||||
-08 float -7 -7.5
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ x
|
|||
123
|
||||
123.45
|
||||
0123
|
||||
07
|
||||
08
|
||||
0b0100
|
||||
0x1000
|
||||
-123
|
||||
|
|
@ -9,3 +11,5 @@ x
|
|||
-0123
|
||||
-0b0100
|
||||
-0x1000
|
||||
-07
|
||||
-08
|
||||
|
|
|
|||
|
Loading…
Add table
Add a link
Reference in a new issue