spring-framework / org.springframework.format.number / AbstractNumberFormatter

AbstractNumberFormatter

abstract class AbstractNumberFormatter : Formatter<Number>

Abstract formatter for Numbers, providing a #getNumberFormat(java.util.Locale) template method.

Author
Juergen Hoeller

Author
Keith Donald

Since
3.0

Constructors

<init>

AbstractNumberFormatter()

Abstract formatter for Numbers, providing a #getNumberFormat(java.util.Locale) template method.

Functions

parse

open fun parse(text: String, locale: Locale): Number

print

open fun print(number: Number, locale: Locale): String

setLenient

open fun setLenient(lenient: Boolean): Unit

Specify whether or not parsing is to be lenient. Default is false.

With lenient parsing, the parser may allow inputs that do not precisely match the format. With strict parsing, inputs must match the format exactly.