+ /**
+ * @deprecated use {@link StringUtils} when updated
+ */
+ @Deprecated
+ private static long toNumber(String value) {
+ // TODO: use StringUtils instead after update
+ long count = 0l;
+ if (value != null) {
+ try {
+ if (value.toLowerCase().endsWith("m")) {
+ count = Long.parseLong(value.substring(0,
+ value.length() - 1).trim());
+ count *= 1000000;
+ } else if (value.toLowerCase().endsWith("k")) {
+ count = Long.parseLong(value.substring(0,
+ value.length() - 1).trim());
+ count *= 1000;
+ } else {
+ count = Long.parseLong(value);
+ }
+ } catch (NumberFormatException pe) {
+ }
+ }
+
+ return count;
+ }
+