Android Open Source - psiandroid Format Utils






From Project

Back to project page psiandroid.

License

The source code is released under:

GNU General Public License

If you think the Android project psiandroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.phpsysinfo.utils;
//w ww.j  a v  a 2  s  .com
import java.text.NumberFormat;

import com.phpsysinfo.R;
import com.phpsysinfo.activity.PSIActivity;

public class FormatUtils
{
  public static String getFormatedMemory(int memory) {
    NumberFormat nf = NumberFormat.getInstance();
    nf.setMaximumFractionDigits(1);
    String value = "0";

    if(memory > 1024*1024) {
      value = nf.format((float)memory/1024/1024) + " " + PSIActivity.getAppContext().getString(R.string.lblTio);
    }
    else if(memory > 1024) {
      value = nf.format((float)memory/1024) + " " + PSIActivity.getAppContext().getString(R.string.lblGio);
    }
    else {
      value = nf.format(memory) + " " + PSIActivity.getAppContext().getString(R.string.lblMio);
    }

    return value;
  }
}




Java Source Code List

com.phpsysinfo.activity.HostListActivity.java
com.phpsysinfo.activity.PSIActivity.java
com.phpsysinfo.activity.PSIConfig.java
com.phpsysinfo.activity.PSIPreferencesActivity.java
com.phpsysinfo.ui.HeaderTextView.java
com.phpsysinfo.utils.FormatUtils.java
com.phpsysinfo.xml.MySSLSocketFactory.java
com.phpsysinfo.xml.PSIBat.java
com.phpsysinfo.xml.PSIDownloadData.java
com.phpsysinfo.xml.PSIErrorCode.java
com.phpsysinfo.xml.PSIHostData.java
com.phpsysinfo.xml.PSIMountPoint.java
com.phpsysinfo.xml.PSINetworkInterface.java
com.phpsysinfo.xml.PSIPrinterItem.java
com.phpsysinfo.xml.PSIPrinter.java
com.phpsysinfo.xml.PSIRaidDevice.java
com.phpsysinfo.xml.PSIRaid.java
com.phpsysinfo.xml.PSISmart.java
com.phpsysinfo.xml.PSITemperature.java
com.phpsysinfo.xml.PSIUps.java
com.phpsysinfo.xml.PSIXmlParse.java