Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
tanlehua committed Apr 4, 2018
1 parent 1443065 commit c70f49b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

public final class PhotoMetadataUtils {
private static final String TAG = PhotoMetadataUtils.class.getSimpleName();
Expand Down Expand Up @@ -166,6 +168,8 @@ private static boolean shouldRotate(ContentResolver resolver, Uri uri) {
}

public static float getSizeInMB(long sizeInBytes) {
return Float.valueOf(new DecimalFormat("0.0").format((float) sizeInBytes / 1024 / 1024));
DecimalFormat df = (DecimalFormat) NumberFormat.getNumberInstance(Locale.US);
df.applyPattern("0.0");
return Float.valueOf(df.format((float) sizeInBytes / 1024 / 1024));
}
}

0 comments on commit c70f49b

Please sign in to comment.