mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +00:00
Better toString for Amount post-issuer refactoring.
This commit is contained in:
parent
a44d3edebf
commit
309159da14
@ -61,7 +61,7 @@ data class Amount<T>(val quantity: Long, val token: T) : Comparable<Amount<T>> {
|
||||
operator fun div(other: Int): Amount<T> = Amount(quantity / other, token)
|
||||
operator fun times(other: Int): Amount<T> = Amount(Math.multiplyExact(quantity, other.toLong()), token)
|
||||
|
||||
override fun toString(): String = (BigDecimal(quantity).divide(BigDecimal(100))).setScale(2).toPlainString()
|
||||
override fun toString(): String = (BigDecimal(quantity).divide(BigDecimal(100))).setScale(2).toPlainString() + " " + token
|
||||
|
||||
override fun compareTo(other: Amount<T>): Int {
|
||||
checkCurrency(other)
|
||||
|
@ -146,10 +146,9 @@ interface IssuanceDefinition
|
||||
*
|
||||
* @param P the type of product underlying the definition, for example [Currency].
|
||||
*/
|
||||
data class Issued<out P>(
|
||||
val issuer: PartyAndReference,
|
||||
val product: P
|
||||
)
|
||||
data class Issued<out P>(val issuer: PartyAndReference, val product: P) {
|
||||
override fun toString() = "$product issued by $issuer"
|
||||
}
|
||||
|
||||
/**
|
||||
* A contract state that can have a single owner.
|
||||
|
Loading…
x
Reference in New Issue
Block a user