Search Results charnumber_to_number




Overview

The APPS.HR_NUMBER package body is a utility package within the Oracle E-Business Suite Human Resources module. Its principal business function is to provide consistent, locale-independent conversion of numeric values between Oracle's internal NUMBER datatype, "canonical" number strings, user-facing display (character) number strings, and character currency strings. Because Oracle EBS is deployed globally, numeric and currency values must be rendered differently depending on the session's NLS (National Language Support) settings — for example, the decimal separator and group separator characters vary by territory. This package isolates that locale-dependent formatting logic so that other HR and web-based components can reliably parse and present numeric and monetary values regardless of the underlying NLS configuration. In the context of the user's search term g_currency, this variable is a package-level global declared as V$NLS_PARAMETERS.VALUE%TYPE, used internally to hold an NLS parameter value (typically the currency formatting characters) retrieved via the package's cursor.

Key Procedures and Functions

Seven documented procedures and functions are exposed by the package:

  • NUMBER_TO_CANONICAL — Converts an Oracle NUMBER into a canonical-format number string, normalizing the decimal separator to a period so the result is independent of the session's NLS numeric characters.
  • CANONICAL_TO_NUMBER — Performs the inverse operation, converting a canonical number string back into an Oracle NUMBER, applying the session's NLS group and decimal separators as required.
  • CHARNUMBER_TO_NUMBER — Converts a character number expressed in display format into an Oracle NUMBER. Per the source, it validates the input using HR_UTIL_MISC_WEB.IS_VALID_NUMBER before conversion.
  • CHARNUMBER_TO_CANONICAL — Converts a display-format character number into its canonical string representation.
  • CANONICAL_TO_CHARNUMBER — Converts a canonical number string into a display-format character number.
  • CANONICAL_TO_CHARCURRENCY — Converts a canonical numeric value into a locale-formatted character currency string, using the NLS currency information held in the package's globals such as g_currency.
  • CHARCURRENCY_TO_CANONICAL — Converts a character currency string back into canonical numeric form, stripping locale-specific currency formatting.

Tables Accessed

The package reads from a single documented data source: the dynamic performance view V$NLS_PARAMETERS, accessed through an APPS synonym. The package declares a cursor, gcsr_group_separator, that selects the VALUE column for a given PARAMETER name. This is used to fetch NLS settings such as NLS_NUMERIC_CHARACTERS (which supplies the group and decimal separators) and the currency-related parameters that populate the g_currency global. No application tables are written; the package is purely a read-and-transform utility.

Usage Notes

HR_NUMBER is typically invoked by other PL/SQL packages, Oracle Forms, and web-based (Self-Service) components that need to present or accept numeric and monetary data in a locale-correct but internally consistent manner. ETRM records that the package is referenced by one other package, indicating its role as a shared low-level utility. Because it depends on V$NLS_PARAMETERS, its behavior is governed by the NLS environment of the calling session, making it suitable for globalized deployments. Developers extending HR functionality should reuse these functions rather than re-implementing NLS-aware number parsing and formatting, ensuring consistent handling of decimal separators, group separators, and currency display across the application.