Code example for BigDecimal

Methods: setScale, toPlainString

0
	public String getActiveInstallsPercentString() {
		return activeInstallsPercentString;
	} 
 
	public void calcActiveInstallsPercentString() { 
		BigDecimal percentBigDecimal = new BigDecimal(getActiveInstallsPercent());
		percentBigDecimal = percentBigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP);
		this.setActiveInstallsPercentString(percentBigDecimal.toPlainString());
	} 
 
	@SuppressLint("SimpleDateFormat") 
	public String getRequestDateString() {
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return dateFormat.format(getRequestDate());
	} 
 
	public double getActiveInstallsPercent() { 
 
		if (totalDownloads < 1) {
			return 0; 
		}