Printing double value - check if it represented as exponential

This commit is contained in:
Konstantin Anisimov
2017-08-04 16:02:22 +07:00
committed by KonstantinAnisimov
parent 8b7cad339e
commit 51f74b4203
@@ -420,7 +420,9 @@ class Launcher(val numWarmIterations: Int, val numMeasureIterations: Int) {
//-----------------------------------------------------------------------------//
fun Double.toString(n: Int): String {
val str = this.toString()
val str = this.toString()
if (str.contains('e', ignoreCase = true)) return str
val len = str.length
val pointIdx = str.indexOf('.')
val dropCnt = len - pointIdx - n - 1