Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

Format for CANADA locale

import java.text.NumberFormat;
import java.util.Locale;

public class Main {
  public static void main(String[] argv) throws Exception {

    Locale locale = Locale.CANADA;
    String string = NumberFormat.getNumberInstance(locale).format(-1234.56); 
    System.out.println(string);

  }
}
//-1,234.56