Rounding service

This service contains various methods used for rounding decimal values for display, printing and rounding of amounts in the system, currency or tender types. Possible changes could be to customize the rounding logic used.

Configurations

There are three different types of rounding configurations that can be configured specifically:

All of the rounding that is done due to these configurations are done through the Rounding service

LS One POS does not have an official scale certification. But LS One POS has gone through most of the process that is necessary to retain the scale certification including the functionality and configuration changes necessary. One of the requirements is that rounding functionality cannot be changed by anyone outside LS Retail (including partners).

 

Some of the methods in this service are as marked as a method that is a part of the "scale certification". If these functions are changed the check sums associated with the scale certification will change and if a scale is connected to the POS the POS will refuse to open itself. In the Logon dialog (under Settings) a list of all functions that are included in the scale certification can be viewed.

Main functionality

 

Name Description
IsLessThanSmallestCoin Returns true if the rounding difference is smaller than the smallest used coin on the tender type that is selected
Round(IConnectionManager, decimal value, RecordIdentifier currencyCode, CacheType) Rounding functionality using the amount rounding configurations in the currency rounding configurations
Round(IConnectionManager, decimal value, RecordIdentifier currencyCode, bool useSalesRounding, CacheType) Rounding functionality using either the sales rounding or the amount rounding configurations in the currency rounding configurations
Round(IConnectionManager, decimal value, int numberOfDecimals, RecordIdentifier currencyCode, CacheType) Rounding functionality using the amount rounding configurations in the currency rounding configurations but the number of decimals is preset using parameter numberOfDecimals
RoundAmount(IConnectionManager, decimal value, decimal roundingValue, TenderRoundMethod roundMethod, CacheType) Rounds an amount using the tender type settings except the rounding method is fixed i.e. the tender rounding method is not used
RoundAmount(IConnectionManager, decimal value, RecordIdentifier storeId, RecordIdentifier tenderTypeId, CacheType) Rounds the tender value according to the tender type and store
RoundAmount(IConnectionManager, decimal value, decimal roundingValue, TenderRoundMethod roundMethod, bool useCurrencySymbol, RecordIdentifier currencyCode, CacheType) Rounds an amount using the tender type settings except the rounding method is fixed i.e. the tender rounding method is not used
RoundAmount(IConnectionManager, decimal value, RecordIdentifier storeId, RecordIdentifier tenderTypeId, bool useCurrencySymbol, RecordIdentifier currencyCode, CacheType) Rounds the tender value according to store
RoundAmountViewer(IConnectionManager, decimal value) Returns a decimal converted as a string with as many decimal numbers as there are in the value
RoundAmountViewer(IConnectionManager, decimal value, RecordIdentifier currencyCode, CacheType) Returns a decimal converted as a string with as many decimal numbers as there are in the currencyUnit value
RoundForDisplay(IConnectionManager, decimal value, bool useCurrencySymbol, bool useSalesRounding, RecordIdentifier currencyCode, CacheType) Returns the rounded value as a string. Rounding functionality using either the sales rounding or the amount rounding configurations in the currency rounding configurations.
RoundForReceipt(IConnectionManager,decimal value, int numberOfDecimals) Returns formated string for receipt displaying.
RoundPrecision(IConnectionManager, decimal value, string priceDecimalPlaces, RecordIdentifier currencyCode,CacheType) A value rounded to the specified precision
RoundQuantity(IConnectionManager, decimal value, RecordIdentifier unitId, RecordIdentifier currencyCode, CacheType) Returns the quantity rounded to the correct value of decimals, corresponding to the settings on the Unit itself.
RoundQuantity(IConnectionManager, decimal value, RecordIdentifier unitId, bool splitItem, RecordIdentifier currencyCode, CacheType) Returns the quantity rounded to the correct value of decimals, corresponding to the settings in the Unit table or the Decimals settings
RoundQuantity(IConnectionManager, decimal value, RecordIdentifier unitId, bool splitItem, RecordIdentifier currencyCode, bool showUOM, CacheType) Returns the quantity rounded to the correct value of decimals, corresponding to the settings in the Unit table or the Decimals settings. If ShowUOM is true the unit name is also included in the return string
RoundString(IConnectionManager, decimal value, RecordIdentifier currencyCode, bool useCurrencySymbol, CacheType)

Returns the rounded value as a string, if useCurrencySymbol is true then the string includes the pre- and suffix value of the currency. Rounding functionality using the amount rounding configurations in the currency rounding configurations.

RoundString(IConnectionManager, decimal value, int numberOfDecimals, bool useCurrencySymbol, RecordIdentifier currencyCode, CacheType) Returns the rounded value as a string, if useCurrencySymbol is true then the string includes the pre- and suffix value of the currency. Rounding functionality using the amount rounding configurations in the currency rounding configurations but the number of decimals is preset using parameter numberOfDecimals.
RoundToUnit(decimal value, decimal unit, RoundMethod roundMethod) Rounds values to nearest currency unit or to the smallest coin
TaxRound(IConnectionManager, decimal value, decimal taxRoundOff, int taxRoundOffType) Rounding of the tax value according to the tax code setup

Development pack

To find this service in the development pack go to DevPack\Source\Core\Common_services

See also