class ActiveSupport::Duration::ISO8601Parser

def number

Parses number which can be a float with either comma or period.
def number
  PERIOD_OR_COMMA.match?(scanner[1]) ? scanner[1].tr(COMMA, PERIOD).to_f : scanner[1].to_i
end