logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Catmandu::Fix::int - convert a value to an integer

Name

       Catmandu::Fix::int - convert a value to an integer

See Also

       Catmandu::Fix

perl v5.40.0                                       2025-01-17                            Catmandu::Fix::int(3pm)

Synopsis

           # year => "2016"
           int(year)
           # year => 2016

           # foo => "bar-123baz"
           int(foo)
           # foo => -123

           # foo => ""
           int(foo)
           # foo => 0

           # foo => "abc"
           int(foo)
           # foo => 0

           # foo => []
           int(foo)
           # foo => 0

           # foo => ["a", "b", "c"]
           int(foo)
           # foo => 3

           # foo => {a => "b", c => "d"}
           int(foo)
           # foo => 2

See Also