Class RussianFormats
java.lang.Object
com.amalgamasimulation.utils.format.Formats
com.amalgamasimulation.utils.format.RussianFormats
-
Field Summary
Fields inherited from class com.amalgamasimulation.utils.format.Formats
AMERICAN, BRITISH, CURRENCIES, CURRENCY_AED, CURRENCY_BRL, CURRENCY_EUR, CURRENCY_GBP, CURRENCY_INR, CURRENCY_RUB, CURRENCY_TRY, CURRENCY_USD, ELLIPSIS, EMPTY_STRING, NEW_LINE, RUSSIAN -
Method Summary
Modifier and TypeMethodDescriptionReturns the specified value without fractional part and with thecurrencysymbol ($, €, etc.) in the beginning.currencyLong(double value, Currency currency) Returns the specified value without fractional part and with the ISO 4217currencycode (USD, EUR, etc.) in the beginning.
Uses the locale-specific thousands separator.currencyLongSign(double value, Currency currency) Returns the specified value without fractional part and with the leading sign (+ or -) followed by the ISO 4217currencycode (USD, EUR, etc.).currencyLongTwoDecimals(double value, Currency currency) Returns the specified value with two digits of fractional part and with the ISO 4217currencycode (USD, EUR, etc.) in the beginning.currencyLongTwoDecimalsSign(double value, Currency currency) Returns the specified value with two digits of fractional part and with the leading sign (+ or -) followed by the ISO 4217currencycode (USD, EUR, etc.).currencySign(double value, Currency currency) Returns the specified value without fractional part and with the leading sign (+ or -) followed by thecurrencysymbol ($, €, etc.).currencyTwoDecimals(double value, Currency currency) Returns the specified value with two digits of fractional part and with thecurrencysymbol ($, €, etc.) in the beginning.currencyTwoDecimalsSign(double value, Currency currency) Returns the specified value with two digits of fractional part and with the leading sign (+ or -) followed by thecurrencysymbol ($, €, etc.).
Uses the locale-specific decimal and thousands separators.customDecimals(double value, int countSign) dayMonthLongYear(LocalDate date) dayMonthYear(LocalDate date) dayMonthYear(LocalDateTime date) dollar(double value) Returns the specified value without fractional part and with the dollar character ($) in the beginning.dollarSign(double value) Returns the specified value without fractional part and with the leading sign (+ or -) followed by the dollar character ($).dollarTwoDecimals(double value) Returns the specified value with two digits of fractional part and with dollar character ($) in the beginning.
Uses the locale-specific decimal and thousands separators.dollarTwoDecimalsSign(double value) Returns the specified value with two digits of fractional part and with the leading sign (+ or -) followed by the dollar character ($).duration(long millis) static RussianFormatshoursMinutes(LocalDateTime date) hoursMinutes(LocalTime date) kmb(double value) Convenient formatting for large values.kmbCurrency(double value, Currency currency) Returns the kmb-formattedvaluewith thecurrencysymbol ($, €, etc.) in the beginning.kmbCurrencyLong(double value, Currency currency) Returns the kmb-formattedvaluewith the ISO 4217currencycode (USD, EUR, etc.) in the beginning.kmbDollars(double value) Returns the kmb-formattedvaluewith the dollar character ($) in the beginning.kmbShort(double value) Convenient formatting for large values.monthLongYear(LocalDate date) monthLongYear(LocalDateTime date) monthYear(LocalDateTime date) noDecimals(double value) Returns the specified value formatted without decimal separator and fractional part.noDecimalsSign(double value) Returns the string representation of the numeric value without any decimal points or fractional parts, including a leading sign (+ or -) based on the value's signparseDayMonthLongYear(String dateString) parseDayMonthLongYearHoursMinutes(String dateString) parseHoursMinutes(String dateString) percent(double value) Returns the specified value formatted as whole percentage without fractional part and with the percent character (%) in the end.percentSign(double value) Returns a string representation of a numeric value formatted as a whole percentage, including a leading sign (+ or -) to indicate whether the percentage is positive or negative.percentTwoDecimals(double value) Returns the specified value formatted as percentage with two decimal digits and with the percent character (%) in the end.percentTwoDecimalsSign(double value) Returns a string representation of a numeric value formatted as a percentage with two decimal places, including a leading sign (+ or -).preciseNumberFormat(double value) rouble(double value) roubleSign(double value) roubleTwoDecimals(double value) roubleTwoDecimalsSign(double value) twoDecimals(double value) Returns the specified value formatted with decimal separator and two digits of fractional part.
Uses the locale-specific decimal and thousands separators.twoDecimalsSign(double value) Returns a string representation of a numeric value formatted with two decimal places, including a leading sign (+ or -).Methods inherited from class com.amalgamasimulation.utils.format.Formats
camelCaseToWords, capitalizeSentence, duration, duration, duration, getCurrencySymbol, getDefaultFormats, getEllipsis, getEmptyString, getNewLine, isRussianFormats, pluralizedEnglishNoun, setDefaultFormats, toBlock, toBlockBySpaces, trim, trimWithEllipsis, trimWithMiddleEllipsis
-
Method Details
-
parseDayMonthLongYearHoursMinutes
- Specified by:
parseDayMonthLongYearHoursMinutesin classFormats
-
parseDayMonthLongYear
- Specified by:
parseDayMonthLongYearin classFormats
-
parseHoursMinutes
- Specified by:
parseHoursMinutesin classFormats
-
customDecimals
- Specified by:
customDecimalsin classFormats
-
getInstance
-
kmbShort
Description copied from class:FormatsConvenient formatting for large values.Works almost like the
Formats.kmb(double)method, but keeps at most one digit in the fractional part (if any).
A single digit in the fractional part is shown only if that digit is the 2nd significant digit and is not zero:kmbShort(1.6)is "1.6"kmbShort(0.8)is "0.8"kmbShort(9_400)is "9.4K"kmbShort(-8_600_000)is "-8.6M"
kmbShort(0)is "0"kmbShort(2)is "2"kmbShort(12_000)is "12K"kmbShort(4_000_000)is "4M"
-
kmb
Description copied from class:FormatsConvenient formatting for large values.
Examples:kmb(0)is "0.00"kmb(12)is "12.0"kmb(120)is "120"kmb(1_200)is "1.20K"kmb(1_200_098)is "1.20M"
Uses the locale-specific decimals separator. -
kmbDollars
Description copied from class:FormatsReturns the kmb-formattedvaluewith the dollar character ($) in the beginning.
Uses the locale-specific thousands separator.- Specified by:
kmbDollarsin classFormats- Parameters:
value- specified value- Returns:
- string representation of the specified value
- See Also:
-
duration
-
noDecimals
Description copied from class:FormatsReturns the specified value formatted without decimal separator and fractional part.
Uses the locale-specific thousands separator.- Specified by:
noDecimalsin classFormats- Parameters:
value- specified value- Returns:
- string representation of the specified value
-
twoDecimals
Description copied from class:FormatsReturns the specified value formatted with decimal separator and two digits of fractional part.
Uses the locale-specific decimal and thousands separators.- Specified by:
twoDecimalsin classFormats- Parameters:
value- specified value- Returns:
- string representation of the specified value
-
percent
Description copied from class:FormatsReturns the specified value formatted as whole percentage without fractional part and with the percent character (%) in the end.
Note that the value is multiplied by 100 when converted to percentage. -
percentTwoDecimals
Description copied from class:FormatsReturns the specified value formatted as percentage with two decimal digits and with the percent character (%) in the end.
Note that the value is multiplied by 100 when converted to percentage.- Specified by:
percentTwoDecimalsin classFormats- Parameters:
value- specified value- Returns:
- string representation of the specified value
-
dollar
Description copied from class:FormatsReturns the specified value without fractional part and with the dollar character ($) in the beginning.
Uses the locale-specific thousands separator. -
dollarTwoDecimals
Description copied from class:FormatsReturns the specified value with two digits of fractional part and with dollar character ($) in the beginning.
Uses the locale-specific decimal and thousands separators.- Specified by:
dollarTwoDecimalsin classFormats- Parameters:
value- specified value- Returns:
- string representation of the specified value
-
noDecimalsSign
Description copied from class:FormatsReturns the string representation of the numeric value without any decimal points or fractional parts, including a leading sign (+ or -) based on the value's sign- Specified by:
noDecimalsSignin classFormats- Parameters:
value- The numeric value to format.- Returns:
- A string representation of the numeric value with no decimals, including a leading sign to indicate positive or negative value
-
twoDecimalsSign
Description copied from class:FormatsReturns a string representation of a numeric value formatted with two decimal places, including a leading sign (+ or -).- Specified by:
twoDecimalsSignin classFormats- Parameters:
value- The numeric value to format.- Returns:
- A formatted string showing the numeric value with two decimal places and a leading sign
-
percentSign
Description copied from class:FormatsReturns a string representation of a numeric value formatted as a whole percentage, including a leading sign (+ or -) to indicate whether the percentage is positive or negative.- Specified by:
percentSignin classFormats- Parameters:
value- The numeric value to format as a percentage, typically a value between 0 and 1- Returns:
- A string representing the numeric value as a whole percentage, with a leading sign
-
percentTwoDecimalsSign
Description copied from class:FormatsReturns a string representation of a numeric value formatted as a percentage with two decimal places, including a leading sign (+ or -).- Specified by:
percentTwoDecimalsSignin classFormats- Parameters:
value- The numeric value to format as a percentage, typically a value between 0 and 1- Returns:
- A formatted string showing the percentage with two decimal places and a leading sign
-
dollarSign
Description copied from class:FormatsReturns the specified value without fractional part and with the leading sign (+ or -) followed by the dollar character ($).
Uses the locale-specific thousands separator.- Specified by:
dollarSignin classFormats- Parameters:
value- specified value- Returns:
- string representation of the specified value
-
dollarTwoDecimalsSign
Description copied from class:FormatsReturns the specified value with two digits of fractional part and with the leading sign (+ or -) followed by the dollar character ($).
Uses the locale-specific decimal and thousands separators.- Specified by:
dollarTwoDecimalsSignin classFormats- Parameters:
value- specified value- Returns:
- string representation of the specified value
-
rouble
-
roubleTwoDecimals
-
roubleSign
-
roubleTwoDecimalsSign
-
monthYear
-
dayMonthYear
- Specified by:
dayMonthYearin classFormats
-
monthLongYear
- Specified by:
monthLongYearin classFormats
-
dayMonthLongYear
- Specified by:
dayMonthLongYearin classFormats
-
hoursMinutes
- Specified by:
hoursMinutesin classFormats
-
preciseNumberFormat
- Specified by:
preciseNumberFormatin classFormats
-
monthYear
-
dayMonthYear
- Specified by:
dayMonthYearin classFormats
-
monthLongYear
- Specified by:
monthLongYearin classFormats
-
dayMonthLongYear
- Specified by:
dayMonthLongYearin classFormats
-
hoursMinutes
- Specified by:
hoursMinutesin classFormats
-
dayMonthLongYearHoursMinutes
- Specified by:
dayMonthLongYearHoursMinutesin classFormats
-
dayMonthHoursMinutes
- Specified by:
dayMonthHoursMinutesin classFormats
-
dayMonthLongYearHoursMinutesSeconds
- Specified by:
dayMonthLongYearHoursMinutesSecondsin classFormats
-
currency
Description copied from class:FormatsReturns the specified value without fractional part and with thecurrencysymbol ($, €, etc.) in the beginning.
Uses the locale-specific thousands separator. -
currencyLong
Description copied from class:FormatsReturns the specified value without fractional part and with the ISO 4217currencycode (USD, EUR, etc.) in the beginning.
Uses the locale-specific thousands separator.- Specified by:
currencyLongin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
-
currencyTwoDecimals
Description copied from class:FormatsReturns the specified value with two digits of fractional part and with thecurrencysymbol ($, €, etc.) in the beginning.
Uses the locale-specific decimal and thousands separators.- Specified by:
currencyTwoDecimalsin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
-
currencyLongTwoDecimals
Description copied from class:FormatsReturns the specified value with two digits of fractional part and with the ISO 4217currencycode (USD, EUR, etc.) in the beginning.
Uses the locale-specific decimal and thousands separators.- Specified by:
currencyLongTwoDecimalsin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
-
currencySign
Description copied from class:FormatsReturns the specified value without fractional part and with the leading sign (+ or -) followed by thecurrencysymbol ($, €, etc.).
Uses the locale-specific thousands separator.- Specified by:
currencySignin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
-
currencyLongSign
Description copied from class:FormatsReturns the specified value without fractional part and with the leading sign (+ or -) followed by the ISO 4217currencycode (USD, EUR, etc.).
Uses the locale-specific thousands separator.- Specified by:
currencyLongSignin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
-
currencyTwoDecimalsSign
Description copied from class:FormatsReturns the specified value with two digits of fractional part and with the leading sign (+ or -) followed by thecurrencysymbol ($, €, etc.).
Uses the locale-specific decimal and thousands separators.- Specified by:
currencyTwoDecimalsSignin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
-
currencyLongTwoDecimalsSign
Description copied from class:FormatsReturns the specified value with two digits of fractional part and with the leading sign (+ or -) followed by the ISO 4217currencycode (USD, EUR, etc.).
Uses the locale-specific decimal and thousands separators.- Specified by:
currencyLongTwoDecimalsSignin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
-
kmbCurrency
Description copied from class:FormatsReturns the kmb-formattedvaluewith thecurrencysymbol ($, €, etc.) in the beginning.
Uses the locale-specific thousands separator.- Specified by:
kmbCurrencyin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
- See Also:
-
kmbCurrencyLong
Description copied from class:FormatsReturns the kmb-formattedvaluewith the ISO 4217currencycode (USD, EUR, etc.) in the beginning.
Uses the locale-specific thousands separator.- Specified by:
kmbCurrencyLongin classFormats- Parameters:
value- specified valuecurrency- currency of the value- Returns:
- string representation of the specified value
- See Also:
-