package ch.pantas.billsplitter.model;

import java.util.ArrayList;

import static ch.pantas.billsplitter.services.AmountCalculator.convertToString;

public enum Currency {
    CHF("CHF", "%s CHF"), EUR("€", "%s €"), USD("$", "$ %s");

    private final String symbol;
    private final String formatTemplate;

    Currency(String symbol, String formatTemplate) {
        this.symbol = symbol;
        this.formatTemplate = formatTemplate;
    }

    public String format(int amountCents) {
        return String.format(formatTemplate, convertToString(amountCents));
    }

    public String getSymbol() {
        return symbol;
    }

    public static String[] getValuesAsString(){
        ArrayList<String> symbols = new ArrayList<String>();
        for(Currency c : values()){
            symbols.add(c.toString());
        }
        String[] buffer = new String[symbols.size()];
        return symbols.toArray(buffer);
    }
}

@@ -479,24 +479,118 @@
 untCents) %7B%0A
+        String amount = convertToString(amountCents);%0A        if(amount.isEmpty()) return %22%22;%0A
         retu
@@ -626,36 +626,14 @@
 te, 
-convertToString(amountCents)
+amount
 );%0A 

Currency formatting returns empty string amount is empty