
package org.missionassetfund.apps.android.utils;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;

public class CurrencyUtils {

    public static final BigDecimal ZERO = new BigDecimal("0.00");

    public static String getCurrencyValueFormatted(BigDecimal value) {
        NumberFormat baseFormat = NumberFormat.getCurrencyInstance();
        return baseFormat.format(value);
    }
    
    public static String getCurrencyValueFormatted(Double value) {
        return getCurrencyValueFormatted(newCurrency(value));
    }
    
    public static String getCurrencyValueFormattedAsNegative(BigDecimal value) {
        return String.format("- %s", getCurrencyValueFormatted(value));
    }
    
    public static BigDecimal newCurrency(Double value) {
        return new BigDecimal(value).setScale(2, RoundingMode.DOWN);
    }

}

@@ -659,36 +659,64 @@
     
-return String.format(%22- %25s%22,
+value = value.multiply(newCurrency(-1d));%0A        return
  get
@@ -740,25 +740,24 @@
 atted(value)
-)
 ;%0A    %7D%0A    

Refactor getCurrencyValueFormattedAsNegative