Percentage

@Serializable
value class Percentage(source)

Contains of1 as main value, where 100% of percentage is when of1 == 1

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val of1: Double

Value of percentage. When it equals to 1, means 100%

Link copied to clipboard

Represent this percentage as common percentage where 100% is 100%

Link copied to clipboard

Same as of100, but float (using Double.toFloat)

Link copied to clipboard

Same as of100, but int (using Double.toInt)

Link copied to clipboard

Same as of1, but float (using Double.toFloat)

Functions

Link copied to clipboard
operator fun Percentage.compareTo(other: Percentage): Int
Link copied to clipboard
operator fun Percentage.div(i: Byte): Percentage
operator fun Percentage.div(i: Double): Percentage
operator fun Percentage.div(i: Float): Percentage
operator fun Percentage.div(i: Int): Percentage
operator fun Percentage.div(i: Long): Percentage
operator fun Percentage.div(i: Short): Percentage
Link copied to clipboard

Will return this if Percentage.of1 in 0 .. 1 range

Link copied to clipboard

Will return this if Percentage.of1 in 0 .. 1 range. Otherwise, will throw error IllegalArgumentException due to require failure

Link copied to clipboard
operator fun Percentage.minus(other: Percentage): Percentage
operator fun Percentage.minus(i: Byte): Percentage
operator fun Percentage.minus(i: Double): Percentage
operator fun Percentage.minus(i: Float): Percentage
operator fun Percentage.minus(i: Int): Percentage
operator fun Percentage.minus(i: Long): Percentage
operator fun Percentage.minus(i: Short): Percentage
Link copied to clipboard
operator fun Percentage.plus(other: Percentage): Percentage
operator fun Percentage.plus(i: Byte): Percentage
operator fun Percentage.plus(i: Double): Percentage
operator fun Percentage.plus(i: Float): Percentage
operator fun Percentage.plus(i: Int): Percentage
operator fun Percentage.plus(i: Long): Percentage
operator fun Percentage.plus(i: Short): Percentage
Link copied to clipboard
operator fun Percentage.rem(i: Byte): Percentage
operator fun Percentage.rem(i: Double): Percentage
operator fun Percentage.rem(i: Float): Percentage
operator fun Percentage.rem(i: Int): Percentage
operator fun Percentage.rem(i: Long): Percentage
operator fun Percentage.rem(i: Short): Percentage
Link copied to clipboard
operator fun Percentage.times(i: Byte): Percentage
operator fun Percentage.times(i: Double): Percentage
operator fun Percentage.times(i: Float): Percentage
operator fun Percentage.times(i: Int): Percentage
operator fun Percentage.times(i: Long): Percentage
operator fun Percentage.times(i: Short): Percentage