Back to project page android-appwidget-cirrus.
The source code is released under:
MIT License
If you think the Android project android-appwidget-cirrus listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* Copyright 2014 Wayne D Grant (www.waynedgrant.com) Licensed under the MIT License */ //w ww.j a va2s . co m package com.waynedgrant.cirrus.presentation.formatters; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.Locale; public class SolarRadiationFormatter { private BigDecimal solarRadiation; public SolarRadiationFormatter(BigDecimal solarRadiation) { this.solarRadiation = solarRadiation; } public String format() { String formatted = "----.- W/m\u00b2"; if (solarRadiation != null) { formatted = String.format(Locale.US, "%1.1f W/m\u00b2", solarRadiation.setScale(1, RoundingMode.HALF_DOWN)); } return formatted; } }