summaryrefslogtreecommitdiff
path: root/blaconvert.java
diff options
context:
space:
mode:
Diffstat (limited to 'blaconvert.java')
-rw-r--r--blaconvert.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/blaconvert.java b/blaconvert.java
index 2741571..e16533f 100644
--- a/blaconvert.java
+++ b/blaconvert.java
@@ -21,7 +21,7 @@
based on code by Jamie Walters <jagw@jagw.co.uk>
based on code by Joe Robinson <joe@lc8n.com>
- Version 1.4
+ Version 1.41
CHANGELOG
1.0 - First version
@@ -36,6 +36,7 @@
1.33 - More euro fixing (maybe)
1.34 - Fixed output of negative numbers
1.4 - Added bitcoin conversion
+ 1.41 - Allowed "bitcoin"(s) in translation string as well as BTC
TODO
- Raw output option - result only with no spaces/commas/units
*/
@@ -55,7 +56,7 @@ public class blaconvert {
String sourceUnit = "";
String targetUnit = "";
String amount = "";
- String version = "1.4";
+ String version = "1.41";
/* Build query from query or arguments, depending on whether
arguments were given. */
@@ -143,7 +144,7 @@ public class blaconvert {
}
//Bitcoin conversion
- if (sourceUnit.trim().toUpperCase().equals("BTC")) {
+ if (sourceUnit.trim().toUpperCase().equals("BTC") || sourceUnit.trim().toUpperCase().contains("BITCOIN")) {
URL url = new URL("https://blockchain.info/tobtc?currency="+targetUnit.toUpperCase()+"&value=1");
try {
URLConnection urlc = url.openConnection();
@@ -163,7 +164,7 @@ public class blaconvert {
System.exit(1);
}
- } else if (targetUnit.trim().toUpperCase().equals("BTC")) {
+ } else if (targetUnit.trim().toUpperCase().equals("BTC") || targetUnit.trim().toUpperCase().contains("BITCOINS")) {
URL url = new URL("https://blockchain.info/tobtc?currency="+sourceUnit.toUpperCase()+"&value="+amount);
URLConnection urlc = url.openConnection();
try {