You are here: Function Reference > Alphabetical Listing > J > JRight

JRight

Use this function to right justify text within a specified length and return the result.

Syntax

JRight (String, Length)

Parameter

Description

String

Enter a valid string. The default is the value of the current field.

Length

Specify the desired length of output. The default is the length of the input string.

The system justifies the text characters of the string parameter within the specified length and returns the new string.

If the length you specify in the Length parameter is longer than the string, the result is increased to the given length before the text is justified.

If the length specified is less than the string, the system uses the length of the string.

Example

Here are some examples:

(Assume the current field contains the text Name and can be up to 20 characters.)

Function

Result

Explanation

JRight

("Heading", 20)

" Heading"

Increases the size of the field to 20 and right justifies the text.

JRight

(" Complete blanks. ", 5)

" Complete blanks. "

Ignores the specified length (5) because it is less than the given string.

JRight ( , SIZE ( ) & "!" )

"Name!"

First the Size function determines that the maximum length of the field is 20. Then the original text in the field is right justified and an exclamation point (!) is concatenated after Name.

Note If you are aligning decimal numbers, be sure to use a fixed or non-proportional font, such as Courier.

See also