From f91b0978eb3f68a783942076f095629f9bf4b509 Mon Sep 17 00:00:00 2001
From: Andras Slemmer <andras.slemmer@r3cev.com>
Date: Fri, 16 Sep 2016 16:02:30 +0100
Subject: [PATCH] explorer: REmoved unused file

---
 .../explorer/formatters/CurrencyFormatter.kt  | 50 -------------------
 1 file changed, 50 deletions(-)
 delete mode 100644 explorer/src/main/kotlin/com/r3corda/explorer/formatters/CurrencyFormatter.kt

diff --git a/explorer/src/main/kotlin/com/r3corda/explorer/formatters/CurrencyFormatter.kt b/explorer/src/main/kotlin/com/r3corda/explorer/formatters/CurrencyFormatter.kt
deleted file mode 100644
index a16aaab8f0..0000000000
--- a/explorer/src/main/kotlin/com/r3corda/explorer/formatters/CurrencyFormatter.kt
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.r3corda.explorer.formatters
-
-import com.r3corda.core.contracts.Amount
-import java.text.DecimalFormat
-import java.util.*
-
-class CurrencyFormatter {
-
-    companion object {
-        private val commaFormatter = DecimalFormat("#,###.00")
-
-        fun currency(formatter: Formatter<Amount<Currency>>) = object : Formatter<Amount<Currency>> {
-            override fun format(value: Amount<Currency>) =
-                    "${value.token.currencyCode} ${formatter.format(value)}"
-        }
-
-        val comma = object : Formatter<Amount<Currency>> {
-            override fun format(value: Amount<Currency>) =
-                    commaFormatter.format(value.quantity / 100.0)
-        }
-
-        data class KmbRange(val fromLog: Double, val toLog: Double, val letter: String, val divider: (Double) -> Double)
-        val kmbRanges = listOf(
-                KmbRange(Double.NEGATIVE_INFINITY, Math.log(1000.0), "", { value -> value }),
-                KmbRange(Math.log(1000.0), Math.log(1000000.0), "k", { value -> value / 1000.0 }),
-                KmbRange(Math.log(1000000.0), Math.log(1000000000.0), "m", { value -> value / 1000000.0 }),
-                KmbRange(Math.log(1000000000.0), Double.POSITIVE_INFINITY, "b", { value -> value / 1000000000.0 })
-        )
-
-        val kmbComma = object : Formatter<Amount<Currency>> {
-            override fun format(value: Amount<Currency>): String {
-                val displayAmount = value.quantity / 100.0
-                val logarithm = Math.log(displayAmount)
-                val rangeIndex = kmbRanges.binarySearch(
-                        comparison = { range ->
-                            if (logarithm < range.fromLog) {
-                                1
-                            } else if (logarithm < range.toLog) {
-                                0
-                            } else {
-                                -1
-                            }
-                        }
-                )
-                val kmbRange = kmbRanges[rangeIndex]
-                return "${commaFormatter.format(kmbRange.divider(displayAmount))}${kmbRange.letter}"
-            }
-        }
-    }
-}