|
|
|
android application insert Data มาเป็นString แล้วเลขที่ได้ ทศนิยมมันมี 4ตำแหน่ง อยากทำให้เหลือ 2ตำแหน่ง |
|
|
|
|
|
|
|
android application insert Data มาเป็นString แล้วเลขที่ได้ ทศนิยมมันมี 4ตำแหน่ง อยากทำให้เหลือ 2ตำแหน่ง
Code (Java)
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_confirm);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
textCustoNo = (TextView) findViewById(R.id.textCustoNo);
textCustuName = (TextView) findViewById(R.id.textCustuName);
textType = (TextView) findViewById(R.id.textType);
textBath = (TextView) findViewById(R.id.textBath);
editTextCradit = (EditText) findViewById(R.id.editTextCradit);
shp = this.getSharedPreferences("UserInfo", MODE_PRIVATE);
String Customer = shp.getString("Customer", "none");
String CustomerNo = shp.getString("CustomerNo", "none");
String Delivery = shp.getString("Delivery", "none");
String Order = shp.getString("Order", "none");
String MainTrx = shp.getString("MainTrx", "none");
String ShipTo = shp.getString("ShipTo", "none");
String Address = shp.getString("Address", "none");
String ReceiptAmount = shp.getString("ReceiptAmount", "none");
String PayTypeCode = shp.getString("PayTypeCode", "none");
String MessengerID = shp.getString("MessengerID", "none");
String userid = shp.getString("UserId", "none");
String password = shp.getString("UserPass", "none");
String DeliveryNo = shp.getString("DeliveryNo", "none");
String BranchCode = shp.getString("BranchCode", "none");
String OrderID = shp.getString("OrderID", "none");
String MainTrxNo = shp.getString("MainTrxNo", "none");
String ShipToID = shp.getString("ShipToID", "none");
String CustomerID = shp.getString("CustomerID", "none");
String CustomerName = shp.getString("CustomerName", "none");
String Latitude = shp.getString("Latitude", "none");
String Longitude = shp.getString("Longitude", "none");
String Pay = shp.getString("Pay", "none");
textCustoNo.setText(CustomerNo);
textCustuName.setText(Customer);
textType.setText(PayTypeCode);
textBath.setText(ReceiptAmount); //ส่วนของที่ต้องการให้แก้ไข format
}
Tag : Mobile, JavaScript, Android, Mobile
|
|
|
|
|
|
Date :
2016-10-25 13:53:15 |
By :
aummyasia |
View :
1005 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|