All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hyperscala.ui.convert.IntConverter.scala Maven / Gradle / Ivy

There is a newer version: 0.10.3
Show newest version
package org.hyperscala.ui.convert

import org.powerscala.reflect.EnhancedClass

/**
 * @author Matt Hicks 
 */
class IntConverter(pre: String = "", post: String = "") extends Converter[Int] {
  def value2String(value: Int) = s"$pre$value$post"

  def string2Value(s: String, clazz: EnhancedClass) = DoubleConverter.string2Value(s, clazz).map(d => math.round(d).toInt)
}

object IntConverter extends IntConverter(pre = "", post = "")




© 2015 - 2024 Weber Informatics LLC | Privacy Policy