Android Open Source - SimpleBitcoinWidget Currency






From Project

Back to project page SimpleBitcoinWidget.

License

The source code is released under:

MIT License

If you think the Android project SimpleBitcoinWidget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.brentpanther.bitcoinwidget;
/* w  ww.  ja  va 2  s  .c  o  m*/
public enum Currency {
  
  USD("$#,###.00", "$#,###"),
  AUD("A$#,###.00", "A$#,###.00", "A$#,###"),
  CAD("C$#,###.00", "C$#,###.00", "C$#,###"),
  CHF("#,###.00 Fr", "#,### Fr"),
  CNY("#,###.00", "#,###"),
  DKK("#,###.00 kr", "#,### kr"),
  EUR("#,###.00", "#,###"),
  GBP("#,###.00", "#,###"),
  HKD("HK$\n#,###.00", "HK$\n#,###"),
  JPY("#,###", "#,###"),
  NZD("NZ$\n#,###.00", "NZ$\n#,###"),
  PLN("#,###.00 z?", "#,### z?"),
  RUB("#,###.00 ???", "#,###.00 ???", "#,###\n???"),
    RUR("#,###.00 ???", "#,###.00 ???", "#,###\n???"), //same as RUR
  SEK("#,### Kr", "#,###.00 Kr", "#,###.00 Kr"),
  SGD("S$#,###.00", "S$#,###.00", "S$\n#,###"),
  THB("?#,###.00", "?#,###"),
    NOK("#,###.00\nKr", "#,### Kr", "#,###\nKr"),
    CZK("#,###.00\nK??", "#,###.00 K??", "#,###\nK??"),
    BRL("R$#,###.00", "R$#,###.00", "R$#,###"),
    ILS("?#,###.00", "?#,###"),
    ZAR("R #,###.00", "R #,###"),
    TRY("#,### TL", "#,### TL"),
    UAH("?#,###", "?#,###"),
    MXN("MX$#,###", "MX$#,####"),
    RON("#,### lei", "#,### lei"),
    KRW("? #,###", "? #,###"),
    IDR("LP#,###,###", "LP#,###,###");

  String format;
    String thousandFormat;
    String tenThousandFormat;

    Currency(String format, String tenThousandFormat) {
        this(format, null, tenThousandFormat);
    }

    Currency(String format, String thousandFormat, String tenThousandFormat) {
        this.format = format;
        this.thousandFormat = thousandFormat;
        this.tenThousandFormat = tenThousandFormat;
    }

    public String getFormat(double amount) {
        if(amount>=10000 && tenThousandFormat != null) return tenThousandFormat;
        if(amount>=1000 && thousandFormat != null) return thousandFormat;
        return format;
    }

}




Java Source Code List

com.brentpanther.bitcoinwidget.BTCProvider.java
com.brentpanther.bitcoinwidget.Currency.java
com.brentpanther.bitcoinwidget.MySSLSocketFactory.java
com.brentpanther.bitcoinwidget.Prefs.java
com.brentpanther.bitcoinwidget.PriceBroadcastReceiver.java
com.brentpanther.bitcoinwidget.SettingsActivity.java
com.brentpanther.bitcoinwidget.TextSizer.java
com.brentpanther.bitcoinwidget.WidgetProvider.java
com.brentpanther.bitcoinwidget.WidgetViews.java
com.brentpanther.brentpanther.ApplicationTest.java