Search in sources :

Example 1 with HelperNumerical

use of net.iGap.helper.HelperNumerical in project iGap-Android by KianIranian-STDG.

the class ElectricityBillMainVM method setDataFromBarcodeScanner.

public void setDataFromBarcodeScanner(String result) {
    if (result != null) {
        if (result.length() == 26) {
            String billId = result.substring(0, 13);
            String payId = result.substring(13, 26);
            String company_type = result.substring(11, 12);
            String price = result.substring(13, 21);
            while (payId.startsWith("0")) {
                payId = payId.substring(1);
            }
            if (!company_type.equals("2")) {
                activateError(R.string.elecBill_Entry_companyError);
                return;
            }
            billID.set(billId);
            billPayID = payId;
            billPrice = new HelperNumerical().getCommaSeparatedPrice((Integer.parseInt(price) * 1000)) + " ریال";
            goToBillDetailFrag.setValue(true);
        } else {
            activateError(R.string.elecBill_Entry_barcodeError);
        }
    }
}
Also used : HelperNumerical(net.iGap.helper.HelperNumerical)

Aggregations

HelperNumerical (net.iGap.helper.HelperNumerical)1