Skip to content

Commit

Permalink
Fixed calculator precision, added honk kong translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarnagiris committed Nov 25, 2014
1 parent d923996 commit 5393683
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
###Version: 0.15.0
- ```new``` Added PIN lock. To enable, go to Settings-Security.
- ```new``` Traditional Chinese translations are also applied to Honk Kong.
- ```fix``` Fixed exchange rate precision.

###Version: 0.14.9
- ```fix``` App launch crash fixed.

###Version: 0.14.8
- ```new``` Added new translations: Tamil, Ukrainian, Turkish.
- ```new``` Updated translations: Chinese Simplified, Slovak, Portuguese Brazil.
Expand Down
2 changes: 1 addition & 1 deletion financius/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
targetSdkVersion 21
minSdkVersion 16
versionCode 67
versionName '0.14.10'
versionName '0.15.0'
multiDexEnabled true
buildConfigField "boolean", "USE_LOCAL_SERVER", "true"
buildConfigField "String", "LOCAL_SERVER_IP", "\"192.168.0.7\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static void start(Context context, String transactionServerId) {
return;
case REQUEST_AMOUNT_TO:
final long amountTo = data.getLongExtra(CalculatorActivity.RESULT_EXTRA_RESULT, 0);
if (Double.compare(model.getExchangeRate(), 0) == 0) {
if (Double.compare(model.getExchangeRate(), 0) <= 0) {
model.setExchangeRate(1.0);
}
final long amount = Math.round(amountTo / model.getExchangeRate());
Expand Down Expand Up @@ -287,8 +287,10 @@ public static void start(Context context, String transactionServerId) {
exchangeRateButton.setVisibility(View.VISIBLE);
amountToButton.setVisibility(View.VISIBLE);

// TODO This is also done in calculator. Do not duplicate.
NumberFormat format = DecimalFormat.getInstance(Locale.ENGLISH);
format.setGroupingUsed(false);
format.setMaximumFractionDigits(20);
exchangeRateButton.setText(format.format(model.getExchangeRate()));
amountToButton.setText(MoneyFormatter.format(transaction.getAccountTo().getCurrency(), Math.round(transaction.getAmount() * transaction.getExchangeRate())));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public void calculate() {
result = interpreter.eval(getExpression()).toString();
final Double number = Double.parseDouble(result);
final NumberFormat format = NumberFormat.getInstance(Locale.ENGLISH);
format.setMaximumFractionDigits(20);
format.setGroupingUsed(false);
result = Double.isInfinite(number) ? null : format.format(number);
} catch (Exception e) {
Expand Down
130 changes: 130 additions & 0 deletions financius/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?><!--Generated by crowdin.com-->
<resources>
<string name="settings">設定</string>
<string name="edit">編輯</string>
<string name="delete">刪除</string>
<string name="save">儲存</string>
<string name="cancel">取消</string>
<string name="done">完成</string>
<string name="ok">確認</string>
<string name="expense">支出</string>
<string name="expenses">花費</string>
<string name="income">收入</string>
<string name="transfer">轉帳</string>
<string name="currencies_zero">貨幣</string>
<string name="currencies_one">貨幣</string>
<string name="currencies_two">貨幣</string>
<string name="currencies_few">貨幣</string>
<string name="currencies_many">貨幣</string>
<string name="currencies_other">貨幣</string>
<string name="currency_code">貨幣代碼</string>
<string name="create">創建</string>
<string name="main_currency">主要貨幣</string>
<string name="set_as_main_currency">設定為主要貨幣</string>
<string name="refresh_rate">更新匯率</string>
<string name="refresh_rates">更新匯率</string>
<string name="exchange_rate">匯率</string>
<string name="accounts_zero">帳戶</string>
<string name="accounts_one">帳戶</string>
<string name="accounts_two">帳戶</string>
<string name="accounts_few">帳戶</string>
<string name="accounts_many">帳戶</string>
<string name="accounts_other">帳戶</string>
<string name="include_in_totals">包含在總計中</string>
<string name="balance">餘額</string>
<string name="title">標題</string>
<string name="note">備註</string>
<string name="select">選取:</string>
<string name="select_color">選擇顏色</string>
<string name="thousands_separator">千位分隔符號</string>
<string name="decimal_separator">小數點</string>
<string name="decimals_count">小數位數</string>
<string name="symbol">符號</string>
<string name="symbol_position">符號位置</string>
<string name="none">無</string>
<string name="comma">逗號</string>
<string name="dot">點</string>
<string name="space">空格</string>
<string name="close_right">緊貼右側</string>
<string name="far_right">與右側間隔</string>
<string name="close_left">緊貼左側</string>
<string name="far_left">與左側間隔</string>
<string name="calculator">計算機</string>
<string name="categories_zero">類別</string>
<string name="categories_one">類別</string>
<string name="categories_two">類別</string>
<string name="categories_few">類別</string>
<string name="categories_many">類別</string>
<string name="categories_other">類別</string>
<string name="transaction_type">交易類型</string>
<string name="account_balance_update">帳戶餘額更新</string>
<string name="color">顏色</string>
<string name="transactions_zero">交易</string>
<string name="transactions_one">交易</string>
<string name="transactions_two">交易</string>
<string name="transactions_few">交易</string>
<string name="transactions_many">交易</string>
<string name="transactions_other">交易</string>
<string name="overview">總覽</string>
<string name="open_navigation">開啟導航列</string>
<string name="close_navigation">關閉導航列</string>
<string name="login">登入</string>
<string name="logout">登出</string>
<string name="user">使用者</string>
<string name="tags_zero">標籤</string>
<string name="tags_one">標籤</string>
<string name="tags_two">標籤</string>
<string name="tags_few">標籤</string>
<string name="tags_many">標籤</string>
<string name="tags_other">標籤</string>
<string name="period">統計週期</string>
<string name="day">每日</string>
<string name="week">每周</string>
<string name="month">每月</string>
<string name="year">每年</string>
<string name="from">從</string>
<string name="to">到</string>
<string name="date">日期</string>
<string name="include_in_reports">在報表中列出</string>
<string name="confirmed">交易已確認</string>
<string name="pending">保存為待確認</string>
<string name="your_data">您的資料</string>
<string name="backup">備份</string>
<string name="clear_and_restore">清除並還原</string>
<string name="file">檔案</string>
<string name="reports">報表</string>
<string name="previous">上一個</string>
<string name="next">下一個</string>
<string name="categories_report">分類報表</string>
<string name="export_csv">匯出CSV檔案</string>
<string name="change_log">更新日誌</string>
<string name="about">關於</string>
<string name="version">版本</string>
<string name="last_updated">上次更新於</string>
<string name="readme">讀我檔案</string>
<string name="rate">評價</string>
<string name="community">社群</string>
<string name="export">匯出</string>
<string name="import_backup">匯入備份</string>
<string name="create_backup">建立備份</string>
<string name="no_category">無類別</string>
<string name="trends">趨勢</string>
<string name="f_change_to_x">更改為 %s</string>
<string name="f_current_main_currency_is_x">目前主要的貨幣是 %s</string>
<string name="f_x_y_will_be_deleted">%1$d %2$s 將會被刪除</string>
<string name="l_refresh_rates_daily">每日更新匯率</string>
<string name="l_currency_exists">這個貨幣已經存在</string>
<string name="l_delete_short">DEL</string>
<string name="l_delete_confirmation">你確定要刪除嗎?</string>
<string name="l_about_new_issue">如有問題或想請求添加新功能,請先檢視讀我檔案。</string>
<string name="l_about_rate">喜歡我嗎?在Google Play上為我評分吧。</string>
<string name="l_about_community">想知道接下來會有什麼改進嗎?那就加入社群吧!</string>
<string name="c_food">食物</string>
<string name="c_leisure">休閒</string>
<string name="c_clothing">服裝</string>
<string name="c_transportation">交通</string>
<string name="c_health_and_beauty">健康與美容</string>
<string name="c_household">日用品</string>
<string name="c_bills_and_utilities">帳單</string>
<string name="c_salary">薪資</string>
</resources>

0 comments on commit 5393683

Please sign in to comment.