mirror of
https://github.com/corda/corda.git
synced 2024-12-20 21:43:14 +00:00
Minor: add extension method to support "1.234".d to create a BigDecimal
This commit is contained in:
parent
dc6ef73b6b
commit
c18579fd60
@ -15,6 +15,7 @@ import com.google.common.util.concurrent.SettableFuture
|
|||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import java.io.BufferedInputStream
|
import java.io.BufferedInputStream
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
import java.math.BigDecimal
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.security.SecureRandom
|
import java.security.SecureRandom
|
||||||
@ -32,6 +33,8 @@ val Int.hours: Duration get() = Duration.ofHours(this.toLong())
|
|||||||
val Int.minutes: Duration get() = Duration.ofMinutes(this.toLong())
|
val Int.minutes: Duration get() = Duration.ofMinutes(this.toLong())
|
||||||
val Int.seconds: Duration get() = Duration.ofSeconds(this.toLong())
|
val Int.seconds: Duration get() = Duration.ofSeconds(this.toLong())
|
||||||
|
|
||||||
|
val String.d: BigDecimal get() = BigDecimal(this)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a random positive long generated using a secure RNG. This function sacrifies a bit of entropy in order to
|
* Returns a random positive long generated using a secure RNG. This function sacrifies a bit of entropy in order to
|
||||||
* avoid potential bugs where the value is used in a context where negative numbers are not expected.
|
* avoid potential bugs where the value is used in a context where negative numbers are not expected.
|
||||||
|
Loading…
Reference in New Issue
Block a user