ParseableDouble

com.phasmidsoftware.gryphon.parse.Parseable.ParseableDouble
See theParseableDouble companion object
trait ParseableDouble extends Parseable[Double]

A trait that provides parsing functionality for strings into Double values.

This trait extends the Parseable typeclass, specifically parameterized for Double. It includes a method for parsing strings into optional Double values.

Attributes

Companion
object
Graph
Supertypes
trait Parseable[Double]
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

def message: String

A method that returns a string representation associated with this trait.

A method that returns a string representation associated with this trait.

Attributes

Returns

The string "Double".

def none: Double

Returns a default value of type T.

Returns a default value of type T.

Attributes

Returns

the default value of type T, typically representing an "empty" or "none" state.

def parse(input: String): Try[Double]

Parses a string input and attempts to convert it into an optional value of type Double.

Parses a string input and attempts to convert it into an optional value of type Double.

Value parameters

input

The string to be parsed into an object of type Double.

Attributes

Returns

An Option containing the parsed object of type Double if successful, or None if the parsing fails.

def regex: Regex

A regular expression used to match numeric values in a string, including integers, floating-point numbers, and numbers with an optional leading or trailing zero.

A regular expression used to match numeric values in a string, including integers, floating-point numbers, and numbers with an optional leading or trailing zero.

Attributes

Returns

A Regex pattern that matches valid numeric representations, such as "42", "3.14", or ".5".