<-- Previous || Up || Next -->

Format Right Justify Truncate Fast Function
Formats Justifies Class

Public Function FormatRightJustifyTruncateFast( _
      ByRef vValue As Variant _
    , ByRef vFormat As String _
    , ByVal vWidth As Long _
    ) As String

Apply the Visual Basic Format function then right justify the result.
Undersized strings are left-padded with spaces to length vWidth.
Oversized strings left-truncated to length vWidth.
"Fast" function has restrictive argument types to avoid argument fix-up code.

Examples:
    FormatRightJustifyTruncateFast(12345, "#,##0", 10) = "    12,345"
    FormatRightJustifyTruncateFast(12345, "#,##0",  5) = "2,345"
See also:
    FormatRightJustifyFast Function
    FormatLeftJustifyTruncateFast Function
    Format$ Function (Visual Basic)
vValue: Value which is to formatted. The formatted result is right-justified.
vFormat: Format specification recognized by the Visual Basic Format function.
vWidth: Length to which the formatted result will be space-filled or truncated.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.