lambdista/money

About a currency not present on actual version.

Closed this issue · 5 comments

Hi, i want to use your api in order to convert currencies in a big data project. I have found that there is at least one currency that is not actually contemplated within Currency trait, CLF, which means Chilean Unidad de Fomento.

What do i have to do? add myself to Currency.scala file this line?

object CLF extends Currency {
val getCode : String = "CLF"

override val toString = getCode
}

Yes please, don't forget the comment. If you know of other missing currencies feel free to add them. Then send a PR and I'll merge it. Thank you.

Hi, I would do it myself, but when I try to recreate the jar with the changes, an exception happens:

This is what I want to include within Currency.scala:

`/*Added new currencies. Alonso Isidoro/
object CLF extends Currency {
val getCode: String = "CLF"

override val toString = getCode
}
object XAG extends Currency {
val getCode: String = "XAG"

override val toString = getCode
}
object CER extends Currency {
val getCode: String = "CER"

override val toString = getCode
}
object XPT extends Currency {
val getCode: String = "XPT"

override val toString = getCode
}
object CNH extends Currency {
val getCode: String = "CNH"

override val toString = getCode
}
object XAU extends Currency {
val getCode: String = "XAU"

override val toString = getCode
}
object ORO extends Currency {
val getCode: String = "ORO"

override val toString = getCode
}
object XPD extends Currency {
val getCode: String = "XPD"

override val toString = getCode
}
object XUL extends Currency {
val getCode: String = "XUL"

override val toString = getCode
}
object UDI extends Currency {
val getCode: String = "UDI"

override val toString = getCode
}
object UVR extends Currency {
val getCode: String = "UVR"

override val toString = getCode
}
object VEB extends Currency {
val getCode: String = "VEB"

override val toString = getCode
}

/*añadidas nuevas currencies. Alonso Isidoro/`

And this is the output of sbt compile command:

money(master)> clean [warn] Credentials file /Users/aisidoro/.ivy2/.credentials does not exist [warn] Binary version (2.11) for dependency org.scala-lang#scala-library;2.11.8 [warn] in com.lambdista#money_2.12;0.6.1 differs from Scala binary version in project (2.12). [warn] Binary version (2.11) for dependency org.scala-lang#scala-library;2.11.8 [warn] in com.lambdista#money_2.12;0.6.1 differs from Scala binary version in project (2.12). [warn] Binary version (2.11) for dependency org.scala-lang#scala-library;2.11.8 [warn] in com.lambdista#money_2.12;0.6.1 differs from Scala binary version in project (2.12). [success] Total time: 0 s, completed 22-nov-2016 9:13:57 money(master)> compile [warn] Credentials file /Users/aisidoro/.ivy2/.credentials does not exist [info] Updating {file:/Users/aisidoro/proyectos_keedio/frtb-currency-converter/money-master/}core... [warn] Binary version (2.11) for dependency org.scala-lang#scala-library;2.11.8 [warn] in com.lambdista#money_2.12;0.6.1 differs from Scala binary version in project (2.12). [info] Resolving com.github.scopt#scopt_2.11;3.5.0 ... [info] Done updating. [warn] Binary version (2.11) for dependency org.scala-lang#scala-library;2.11.8 [warn] in com.lambdista#money_2.12;0.6.1 differs from Scala binary version in project (2.12). [info] Updating {file:/Users/aisidoro/proyectos_keedio/frtb-currency-converter/money-master/}examples... [error] a module is not authorized to depend on itself: com.lambdista#money_2.12;0.6.1 [info] Compiling 5 Scala sources to /Users/aisidoro/proyectos_keedio/frtb-currency-converter/money-master/core/target/scala-2.12/classes... [info] 'compiler-interface' not yet compiled for Scala 2.12.0. Compiling... [info] Resolving org.scala-sbt#interface;0.13.13 ... [trace] Stack trace suppressed: run last examples/*:update for the full output. [trace] Stack trace suppressed: run last core/compile:compileIncremental for the full output. [error] (examples/*:update) java.lang.IllegalArgumentException: a module is not authorized to depend on itself: com.lambdista#money_2.12;0.6.1 [error] (core/compile:compileIncremental) java.lang.UnsupportedClassVersionError: scala/tools/nsc/Main : Unsupported major.minor version 52.0 [error] Total time: 1 s, completed 22-nov-2016 9:14:02

Please, could you do it for me and upgrade the project version?

Thank you

Hi Alonso,

I'll do it for you then. Would you mind sending that list again completed with comments explaining which currency each of them is? E.g.:

/**
  * United Arab Emirates Dirham
  */
object AED extends Currency {
  val getCode: String = "AED"

  override val toString = getCode
}

Thanks.

Hi Alessandro,

`/*Added new currencies. Alonso Isidoro/

/***

  • Chilean Unidad de Fomento
    */
    object CLF extends Currency {
    val getCode: String = "CLF"

override val toString = getCode
}

/***

  • Onza de plata
    */
    object XAG extends Currency {
    val getCode: String = "XAG"

override val toString = getCode
}

/***

  • Coeficiente de Estabilización de Referencia
    */
    object CER extends Currency {
    val getCode: String = "CER"

override val toString = getCode
}
object XPT extends Currency {
val getCode: String = "XPT"

override val toString = getCode
}

/***

  • Official currency people republic of China. Renminbi
    */
    object CNH extends Currency {
    val getCode: String = "CNH"

override val toString = getCode
}

/***

  • Gold exchange rate.
    */
    object XAU extends Currency {
    val getCode: String = "XAU"

override val toString = getCode
}

/***

  • ??
    */
    object ORO extends Currency {
    val getCode: String = "ORO"

override val toString = getCode
}

/***

  • Onza de Paladio
    */
    object XPD extends Currency {
    val getCode: String = "XPD"

override val toString = getCode
}

/***

  • ??
    */
    object XUL extends Currency {
    val getCode: String = "XUL"

override val toString = getCode
}

/***

  • Mexican currency fund unit
    */
    object UDI extends Currency {
    val getCode: String = "UDI"

override val toString = getCode
}

/***

  • Unidad de valor real. Colombia
    */
    object UVR extends Currency {
    val getCode: String = "UVR"

override val toString = getCode
}

/***

  • Venezuelan Bolivar Rate
    */
    object VEB extends Currency {
    val getCode: String = "VEB"

override val toString = getCode
}

/*añadidas nuevas currencies. Alonso Isidoro/`

There are two of them that i wasnt capable to find a significance, XUL and ORO. It has to mean something, but actually i do not know.

Please, could you add this to the project, compile and upload it to maven central with a new version, maybe 0.6.2?

Thank you

Alonso

Done