Package-level declarations

Types

Link copied to clipboard

Class for parsing and formatting a Number from/to a String.

Link copied to clipboard
enum Flag : Enum<Flag>

Modifying flags for a Formattable that modify the output

Link copied to clipboard
interface Formattable

Interface that adds support for an object to be formatted by StringFormatter.

Link copied to clipboard
sealed class NumberFormatStyle

Style used for formatting a Number to and from a String

Link copied to clipboard

Default implementation of BaseNumberFormatter

Default implementation of BaseNumberFormatter

expect class NumberFormatter(locale: KalugaLocale = defaultLocale, style: NumberFormatStyle = NumberFormatStyle.Decimal()) : BaseNumberFormatter

Default implementation of BaseNumberFormatter

Default implementation of BaseNumberFormatter

Default implementation of BaseNumberFormatter

Default implementation of BaseNumberFormatter backed by the ECMAScript Intl.NumberFormat API, shared by the JS family (js + wasmJs) via typed Intl externals.

Link copied to clipboard

Rounding mode applied when rounding aa given Number while formatting

Link copied to clipboard
class StringFormatter(out: StringBuilder = StringBuilder(), locale: KalugaLocale = defaultLocale)

Formats a given String using a printf-style format strings. Supports formats for Number, String, Char, Boolean, and com.splendo.kaluga.datetime.KalugaDate. Custom formatting is supported by implementing Formattable. Flags, precision and width are supported by this formatter as well. Formatting will adjust for a provided KalugaLocale. May throw a StringFormatterException if the incorrect format is applied.

Link copied to clipboard

List of exceptions that may be thrown by a StringFormatter.

Properties

Link copied to clipboard
actual val lineSeparator: String

The String that serves as a line separator.

actual val lineSeparator: String

The String that serves as a line separator.

expect val lineSeparator: String

The String that serves as a line separator.

actual val lineSeparator: String

The String that serves as a line separator.

actual val lineSeparator: String

The String that serves as a line separator. Shared by the JS family (js + wasmJs).

Functions

Link copied to clipboard
fun String.format(vararg args: Any?, locale: KalugaLocale = defaultLocale): String

Formats this String as a printf-style format String using a variable number of arguments.

Link copied to clipboard