{"record":{"id":"7448c616940d5595","repo":"RubyMoney/money","slug":"amount-must-be-numeric","errorCode":null,"errorMessage":"'amount' must be numeric","messagePattern":"'amount' must be numeric","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/money/money.rb","lineNumber":317,"sourceCode":"  end\n\n  # Creates a new Money object of value given in the +unit+ of the given\n  # +currency+.\n  #\n  # @param [Numeric] amount The numerical value of the money.\n  # @param [Currency, String, Symbol] currency The currency format.\n  # @param [Hash] options Optional settings for the new Money instance\n  # @option [Money::Bank::*] :bank The exchange bank to use.\n  #\n  # @example\n  #   Money.from_amount(23.45, \"USD\") # => #<Money fractional:2345 currency:USD>\n  #   Money.from_amount(23.45, \"JPY\") # => #<Money fractional:23 currency:JPY>\n  #\n  # @return [Money]\n  #\n  # @see #initialize\n  def self.from_amount(amount, currency = default_currency, options = {})\n    raise ArgumentError, \"'amount' must be numeric\" unless amount.is_a?(Numeric)\n\n    currency = Currency.wrap(currency) || Money.default_currency\n    raise Currency::NoCurrency, \"must provide a currency\" if currency.nil?\n\n    value = amount.to_d * currency.subunit_to_unit\n    new(value, currency, options)\n  end\n\n  # DEPRECATED.\n  #\n  # @see Money.from_amount\n  def self.from_dollars(amount, currency = default_currency, options = {})\n    warn \"[DEPRECATION] `Money.from_dollars` is deprecated in favor of \" \\\n         \"`Money.from_amount`.\"\n\n    from_amount(amount, currency, options)\n  end\n","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/RubyMoney/money/blob/26e2829c34f165847040a5a40d4d2daa5eb72927/lib/money/money.rb#L299-L335","documentation":"Error \"'amount' must be numeric\" thrown in RubyMoney/money.","triggerScenarios":"Thrown at lib/money/money.rb:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26e2829c34f165847040a5a40d4d2daa5eb72927","analyzedAt":"2026-08-23T17:41:07.306Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}