Package org.drip.service.common
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.
- Module = Computational Core Module
- Library = Numerical Analysis Library
- 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 dblValue, int iNumLeft, int iNumRight, double dblMultiplier)
Format the double input by multiplying, and then adding left and right adjustmentsstatic 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 adjustmentsstatic java.lang.String
PrePad(int i)
Pre-pad a single digit integer with zerosMethods 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 inputiNumLeft
- Integer representing the number of left justifying zerosiNumRight
- Integer representing the number of right justifying zerosdblMultiplier
- Double representing the multiplierbLeadingSpaceForPositive
- 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 inputiNumLeft
- Integer representing the number of left justifying zerosiNumRight
- Integer representing the number of right justifying zerosdblMultiplier
- Double representing the multiplier- Returns:
- String representing the formatted input
-