mirror of
https://github.com/corda/corda.git
synced 2025-04-15 15:07:03 +00:00
Merge branch 'master' of https://bitbucket.org/R3-CEV/r3prototyping
This commit is contained in:
commit
a624ef7ff5
@ -58,7 +58,7 @@ data class Amount(val pennies: Long, val currency: Currency) : Comparable<Amount
|
||||
operator fun div(other: Int): Amount = Amount(pennies / other, currency)
|
||||
operator fun times(other: Int): Amount = Amount(Math.multiplyExact(pennies, other.toLong()), currency)
|
||||
|
||||
override fun toString(): String = currency.currencyCode + " " + (BigDecimal(pennies) / BigDecimal(100)).toPlainString()
|
||||
override fun toString(): String = currency.currencyCode + " " + (BigDecimal(pennies).divide(BigDecimal(100))).setScale(2).toPlainString()
|
||||
|
||||
override fun compareTo(other: Amount): Int {
|
||||
checkCurrency(other)
|
||||
|
@ -10,9 +10,17 @@ package core
|
||||
|
||||
import org.junit.Test
|
||||
import java.time.LocalDate
|
||||
import java.util.*
|
||||
|
||||
class FinanceTypesTest {
|
||||
|
||||
@Test
|
||||
fun `make sure Amount has decimal places`() {
|
||||
var x = Amount(1, Currency.getInstance("USD"))
|
||||
assert("0.01" in x.toString())
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
fun `schedule generator 1`() {
|
||||
var ret = BusinessCalendar.createGenericSchedule(startDate = LocalDate.of(2014, 11, 25), period = Frequency.Monthly, noOfAdditionalPeriods = 3)
|
||||
|
4
docs/build/html/getting-set-up.html
vendored
4
docs/build/html/getting-set-up.html
vendored
@ -162,7 +162,7 @@
|
||||
then clicking “Install JetBrains plugin”, then searching for Kotlin, then hitting “Upgrade” and then “Restart”.</p>
|
||||
<p>Choose “Check out from version control” and use this git URL</p>
|
||||
<blockquote>
|
||||
<div><a class="reference external" href="https://your_username@bitbucket.org/R3-CEV/r3repository.git">https://your_username@bitbucket.org/R3-CEV/r3repository.git</a></div></blockquote>
|
||||
<div><a class="reference external" href="https://your_username@bitbucket.org/R3-CEV/r3prototyping.git">https://your_username@bitbucket.org/R3-CEV/r3prototyping.git</a></div></blockquote>
|
||||
<p>Agree to the defaults for importing a Gradle project. Wait for it to think and download the dependencies.</p>
|
||||
<p>Right click on the tests directory, click “Run -> All Tests” (note: NOT the first item in the submenu that has the
|
||||
gradle logo next to it).</p>
|
||||
@ -260,4 +260,4 @@ found at something like</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -7,9 +7,7 @@ if [ ! -e ./gradlew ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d build/install/r3prototyping ]; then
|
||||
./gradlew installDist
|
||||
fi
|
||||
./gradlew installDist
|
||||
|
||||
if [[ "$mode" == "buyer" ]]; then
|
||||
if [ ! -d buyer ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user