Click or drag to resize

IOperationServiceRegisterCustomRoundingHandler Method

Allows to provide custom order sum rounding implementation.

Namespace:  Resto.Front.Api
Assembly:  Resto.Front.Api.V7 (in Resto.Front.Api.V7.dll)
Syntax
C#
IDisposable RegisterCustomRoundingHandler(
	Func<IOrder, decimal> callback
)

Parameters

callback
Type: SystemFuncIOrder, Decimal
The rounding logic implementation, which will be called to calculate order sum. Callback gets an order and returns a sum, by which the result sum of the order should be increased or decreased. In case of zero no rounding will be applied, in case of an exception default rounding will be applied.

Return Value

Type: IDisposable
Remarks
Usually order sum rounding is used to speed up the service and convenience of customers by discarding pennies, or as a legal requirement. For example, if ResultSum is 1320.74, the callback may return -0.74 to round the sum down to 1320, or return 0.01 to round the sum up to 1320.75 (to the nearest multiple of 0.05).
See Also