package com.fusi24.rfid.util;

import android.content.Context;
import android.content.SharedPreferences;

import java.util.Locale;

public class Helper {

    private static final String PREF_NAME = "hse_pref_name";

    public static SharedPreferences getDefaultPreferences(Context context) {
        return context.getSharedPreferences(PREF_NAME, 0);
    }

    public static String formatRfidNumber(String numberRfidTemp){
        if (numberRfidTemp.length() < 10){
            return String.format(Locale.getDefault(), "%010d", Integer.valueOf(numberRfidTemp));
        } else {
            return numberRfidTemp;
        }
    }
}
