Package-level declarations

Types

Link copied to clipboard

Interface for parsing and formatting a KalugaDate from/to a String.

Link copied to clipboard

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

Link copied to clipboard

Style used for formatting a KalugaDate to and from a String

Link copied to clipboard
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

Default implementation of BaseDateFormatter

Default implementation of BaseDateFormatter

actual class KalugaDateFormatter

Default implementation of BaseDateFormatter

Default implementation of BaseDateFormatter

Default implementation of BaseDateFormatter

Link copied to clipboard

Style used for formatting a Number to and from a String

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

Default implementation of BaseNumberFormatter

actual class NumberFormatter

Default implementation of BaseNumberFormatter

Default implementation of BaseNumberFormatter

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.base.utils.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.

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.

actual val lineSeparator: String

The String that serves as a line separator.

Functions

Link copied to clipboard
fun KalugaDateFormatter.Companion.dateFormat(style: DateFormatStyle = DateFormatStyle.Medium, excludeYear: Boolean, timeZone: KalugaTimeZone = KalugaTimeZone.current(), locale: KalugaLocale = defaultLocale): KalugaDateFormatter

Creates a KalugaDateFormatter that only formats the date components of a KalugaDate

Link copied to clipboard
fun KalugaDateFormatter.Companion.dateTimeFormat(dateStyle: DateFormatStyle = DateFormatStyle.Medium, excludeYear: Boolean, timeStyle: DateFormatStyle = DateFormatStyle.Medium, timeZone: KalugaTimeZone = KalugaTimeZone.current(), locale: KalugaLocale = defaultLocale): KalugaDateFormatter

Creates a KalugaDateFormatter that formats both date and time components of a KalugaDate

Link copied to clipboard

Creates a fixed KalugaDateFormatter using a custom Date format pattern, localized by the KalugaLocale.enUsPosix. Use this to ensure that displaying time in 12 or 24 hour format is not overridden by the user.

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

Creates a KalugaDateFormatter that formats time according to the ISo 8601 format.

Link copied to clipboard
actual fun String.lowerCased(locale: KalugaLocale): String

Converts a String to its lower cased variant based on a given KalugaLocale

expect fun String.lowerCased(locale: KalugaLocale): String

Converts a String to its lower cased variant based on a given KalugaLocale

actual fun String.lowerCased(locale: KalugaLocale): String

Converts a String to its lower cased variant based on a given KalugaLocale

actual fun String.lowerCased(locale: KalugaLocale): String

Converts a String to its lower cased variant based on a given KalugaLocale

actual fun String.lowerCased(locale: KalugaLocale): String

Converts a String to its lower cased variant based on a given KalugaLocale

Link copied to clipboard
Link copied to clipboard
actual fun String.upperCased(locale: KalugaLocale): String

Converts a String to its upper cased variant based on a given KalugaLocale

expect fun String.upperCased(locale: KalugaLocale): String

Converts a String to its upper cased variant based on a given KalugaLocale

actual fun String.upperCased(locale: KalugaLocale): String

Converts a String to its upper cased variant based on a given KalugaLocale

actual fun String.upperCased(locale: KalugaLocale): String

Converts a String to its upper cased variant based on a given KalugaLocale

actual fun String.upperCased(locale: KalugaLocale): String

Converts a String to its upper cased variant based on a given KalugaLocale