Class FormatUtil

java.lang.Object
org.drip.service.common.FormatUtil

public class FormatUtil
extends java.lang.Object
FormatUtil implements formatting utility functions. Currently it just exports functions to pad and format. It implements the following Functions:
  • Pre-pad a single digit integer with zeros
  • Format the double input by multiplying, and then adding left and right adjustments
  • Format the double input by multiplying, and then adding left and right adjustments with leading Space

Module Computational Core Module
Library Computation Support
Project Environment, Product/Definition Containers, and Scenario/State Manipulation APIs
Package Assorted Data Structures Support Utilities
Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    FormatUtil()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String FormatDouble​(double doubleValue, int leftJustificationZeroes, int rightJustificationZeroes, double multiplier)
    Format the double input by multiplying, and then adding left and right adjustments
    static java.lang.String FormatDouble​(double doubleValue, int leftJustificationZeroes, int rightJustificationZeroes, double multiplier, boolean leadingSpaceForPositive)
    Format the double input by multiplying, and then adding left and right adjustments
    static java.lang.String PrePad​(int i)
    Pre-pad a single digit integer with zeros

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FormatUtil

      public FormatUtil()
  • Method Details

    • PrePad

      public static final java.lang.String PrePad​(int i)
      Pre-pad a single digit integer with zeros
      Parameters:
      i - Integer representing the input
      Returns:
      String representing the padded output
    • FormatDouble

      public static final java.lang.String FormatDouble​(double doubleValue, int leftJustificationZeroes, int rightJustificationZeroes, double multiplier, boolean leadingSpaceForPositive)
      Format the double input by multiplying, and then adding left and right adjustments
      Parameters:
      doubleValue - Double representing the input
      leftJustificationZeroes - Integer representing the number of left justifying zeros
      rightJustificationZeroes - Integer representing the number of right justifying zeros
      multiplier - Double representing the multiplier
      leadingSpaceForPositive - TRUE - A Leading Space will be emitted for Adjusted Positive Numbers. For Adjusted Negatives this will be the '-' sign.
      Returns:
      String representing the formatted input
    • FormatDouble

      public static final java.lang.String FormatDouble​(double doubleValue, int leftJustificationZeroes, int rightJustificationZeroes, double multiplier)
      Format the double input by multiplying, and then adding left and right adjustments
      Parameters:
      doubleValue - Double representing the input
      leftJustificationZeroes - Integer representing the number of left justifying zeros
      rightJustificationZeroes - Integer representing the number of right justifying zeros
      multiplier - Double representing the multiplier
      Returns:
      String representing the formatted input