{"record":{"id":"bfcee3d9c39e36c9","repo":"flippercloud/flipper","slug":"value-inspect-cannot-be-converted-to-a-float","errorCode":null,"errorMessage":"#{value.inspect} cannot be converted to a float","messagePattern":"#(.+?) cannot be converted to a float","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/flipper/typecast.rb","lineNumber":38,"sourceCode":"\n    # Internal: Convert value to an integer.\n    #\n    # Returns an Integer representation of the value.\n    # Raises ArgumentError if conversion is not possible.\n    def self.to_integer(value)\n      value.to_i\n    rescue NoMethodError\n      raise ArgumentError, \"#{value.inspect} cannot be converted to an integer\"\n    end\n\n    # Internal: Convert value to a float.\n    #\n    # Returns a Float representation of the value.\n    # Raises ArgumentError if conversion is not possible.\n    def self.to_float(value)\n      value.to_f\n    rescue NoMethodError\n      raise ArgumentError, \"#{value.inspect} cannot be converted to a float\"\n    end\n\n    # Internal: Convert value to a number.\n    #\n    # Returns a Integer or Float representation of the value.\n    # Raises ArgumentError if conversion is not possible.\n    def self.to_number(value)\n      case value\n      when Numeric\n        value\n      when String\n        value.include?('.') ? to_float(value) : to_integer(value)\n      when NilClass\n        0\n      else\n        value.to_f\n      end\n    rescue NoMethodError","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/flippercloud/flipper/blob/1f86de3ec91521585b156445e156642938b19cb0/lib/flipper/typecast.rb#L20-L56","documentation":"Error \"#{value.inspect} cannot be converted to a float\" thrown in flippercloud/flipper.","triggerScenarios":"Thrown at lib/flipper/typecast.rb:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a Float/Numeric or a numeric String; other types cannot be typecast","Convert the value with to_f before passing it to Flipper","Check the source of the value; nil or arbitrary objects are rejected"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1f86de3ec91521585b156445e156642938b19cb0","analyzedAt":"2026-08-23T04:36:09.896Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}