toDecimalNumber

Checks if the string can be parsed as a decimal number (Double).

This property uses toDoubleOrNull to safely attempt the conversion. It returns true if the string represents a valid floating-point number, and false otherwise.

Examples:

  • "123.45".toDecimalNumber -> true

  • "-50".toDecimalNumber -> true

  • "abc".toDecimalNumber -> false

  • "".toDecimalNumber -> false

Return

true if the string is a valid decimal number, false otherwise.