json_native0.5_3.4.0.2.source-code.ToDecimalChar.scala Maven / Gradle / Ivy
The newest version!
package ujson
object MathUtilsChar{
def toString(bytes: Array[Char], index: Int, s: String) = {
val len = s.length
var i = 0
while (i < len) {
bytes(index + i) = s.charAt(i).toChar
i += 1
}
len
}
}
object DoubleToDecimalChar{
def toString(bytes: Array[Char], index: Int, v: Double) = {
MathUtilsChar.toString(bytes, index, v.toString)
}
}
object FloatToDecimalChar{
def toString(bytes: Array[Char], index: Int, v: Float) = {
MathUtilsChar.toString(bytes, index, v.toString)
}
}