Commit 7f39d0c5 by Kim Jinsung

THETA SC2端末で露出情報表示問題対応

parent fe935b79
...@@ -17,6 +17,8 @@ import java.io.IOException; ...@@ -17,6 +17,8 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
...@@ -1435,7 +1437,15 @@ public class HttpConnector { ...@@ -1435,7 +1437,15 @@ public class HttpConnector {
if (status.equals("done")) { if (status.equals("done")) {
JSONObject results = output.getJSONObject("results"); JSONObject results = output.getJSONObject("results");
JSONObject options = results.getJSONObject("options"); JSONObject options = results.getJSONObject("options");
exposureCompensation = options.getString("exposureCompensation"); double exposure = options.getDouble("exposureCompensation");
if (exposure == 0) {
exposureCompensation = "0.0";
} else {
BigDecimal decimal = new BigDecimal(String.valueOf(exposure));
BigDecimal halfUp = decimal.setScale(1, RoundingMode.HALF_UP); //小数点1桁まで表示し、2桁で切り上げ
exposureCompensation = halfUp.toPlainString();
}
} }
} catch (IOException e) { } catch (IOException e) {
Logger.e(TAG, e); Logger.e(TAG, e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment