Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to round Double to 2 digit decimals

import java.math.BigDecimal
import java.math.RoundingMode
val decimal = BigDecimal(3.14159265359).setScale(2, RoundingMode.HALF_EVEN)
println(decimal) // 3.14
Source by discuss.kotlinlang.org #
 
PREVIOUS NEXT
Tagged: #Double #digit #decimals
ADD COMMENT
Topic
Name
6+7 =