This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
public static void main(String[] args) { | |
double d = 756.2345566; | |
//方法一:最简便的方法,调用DecimalFormat类 | |
DecimalFormat df = new DecimalFormat(".00"); | |
System.out.println(df.format(d)); | |
//方法二:直接通过String类的format函数实现 | |
System.out.println(String.format("%.2f", d)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.os.Looper; | |
import rx.Observable; | |
import rx.Scheduler; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <QCoreApplication> | |
using namespace std; | |
/** | |
* Type: Tower | |
* ------------- | |
* This structure contains the name of the tower and a link to the next one. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: charstack.cpp | |
* --------------------- | |
* This file implements the CharStack class using a Vector<char> as the | |
* underlying representation. The Vector class already implements most of | |
* the essential operations for the CharStack class, which can simply | |
* forward the request on to the underlying structure. The methods are | |
* short enough to require no detailed documentation. | |
*/ |