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.



Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    FormatUtil()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String FormatDouble​(double dblValue, int iNumLeft, int iNumRight, double dblMultiplier)
    Format the double input by multiplying, and then adding left and right adjustments
    static java.lang.String FormatDouble​(double dblValue, int iNumLeft, int iNumRight, double dblMultiplier, boolean bLeadingSpaceForPositive)
    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 dblValue, int iNumLeft, int iNumRight, double dblMultiplier, boolean bLeadingSpaceForPositive)
      Format the double input by multiplying, and then adding left and right adjustments
      Parameters:
      dblValue - Double representing the input
      iNumLeft - Integer representing the number of left justifying zeros
      iNumRight - Integer representing the number of right justifying zeros
      dblMultiplier - Double representing the multiplier
      bLeadingSpaceForPositive - 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 dblValue, int iNumLeft, int iNumRight, double dblMultiplier)
      Format the double input by multiplying, and then adding left and right adjustments
      Parameters:
      dblValue - Double representing the input
      iNumLeft - Integer representing the number of left justifying zeros
      iNumRight - Integer representing the number of right justifying zeros
      dblMultiplier - Double representing the multiplier
      Returns:
      String representing the formatted input