package com.bitnix.dirtcryptostore.util;

public final class TimeUtil {

    private TimeUtil() {
    }

    public static String formatRemaining(long millis) {
        long totalSeconds = Math.max(0L, millis / 1000L);
        long minutes = totalSeconds / 60L;
        long seconds = totalSeconds % 60L;
        return minutes + "m " + seconds + "s";
    }

    public static String formatBtcAmount(long sats) {
        long whole = sats / 100_000_000L;
        long fractional = sats % 100_000_000L;
        return whole + "." + String.format("%08d", fractional) + " BTC";
    }

    public static String formatBtcRaw(long sats) {
        long whole = sats / 100_000_000L;
        long fractional = sats % 100_000_000L;
        return whole + "." + String.format("%08d", fractional);
    }
}
