Java tutorial
//package com.java2s; import java.util.Locale; public class Main { /** * * @param heading * @return */ public static String correctConvertHeading(long heading) { String ret = String.format(Locale.getDefault(), "%03d", heading); if (ret.equals("000")) { ret = "360"; } return ret; } }