jsky.util
Class FormatUtilities

java.lang.Object
  extended by jsky.util.FormatUtilities

public class FormatUtilities
extends Object

This is an all-static class that contains methods are generic in value and related to format objects.

This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project for Next Generation Space Telescope (NGST).

Version:
5.25.00
Author:
Sandy Grosvenor

Constructor Summary
FormatUtilities()
           
 
Method Summary
static String formatDouble(double inVal, int inDecs)
          Formats a double value to specified number of decimal places, including using scientific notation if appropriate.
static String formatDouble(double inVal, int inDecs, int inLeftOfDec)
          Formats a double value to specified number of decimal places, including using scientific notation if appropriate.
static void writeError(Object source, Object message)
          Display a simple error message to System.err
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatUtilities

public FormatUtilities()
Method Detail

writeError

public static void writeError(Object source,
                              Object message)
Display a simple error message to System.err


formatDouble

public static String formatDouble(double inVal,
                                  int inDecs)
Formats a double value to specified number of decimal places, including using scientific notation if appropriate. Uses default value of 14 places to left of decimal.

Parameters:
inVal - double number to be formatted
inLeftOfDec - integer of max number of places to left of decimal

formatDouble

public static String formatDouble(double inVal,
                                  int inDecs,
                                  int inLeftOfDec)
Formats a double value to specified number of decimal places, including using scientific notation if appropriate.

Parameters:
inVal - double number to be formatted
inDecs - integer of number of decimal places
inLeftOfDec - integer of max number of places to left of decimal


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.