- API
- Data types
- Money
- Getting started [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
- Manage types
- Global context and isolation
- Manage apps
- Batch actions with app items
- Manage external services
- Scripts in widgets
- Web components
- Access permissions
- Getting started with processes
- Getting started with signatures
- Getting started with file previews
- Getting started with the organizational chart
- Getting started with users and groups
-
Getting started with the
Table data type -
Getting started with the
Category data type - Dynamic event type calculation
- Typical use cases
-
API
- Object types
-
Data types
- AccountType
- DynamicFieldType
- EmailType
- OrganisationStructureItemType
- PhoneType
- ReplacementType
- ServiceStatus
- UserStatus
- WatermarkPages
- WatermarkPosition
- AccountFieldTyped
- AccountFieldVoid
- ApplicationField
- Cell
- ClientEventField
- CookieOptions
- DatetimeFieldData
- DynamicBindingField
- DynamicBindingFields
- EnumField
- ErrorArgs
- ErrorObject
- FileField
- FloatFieldData
- GroupStatusField
- HttpResponse
- ImageField
- Language
- MailMessageAddress
- MailMessageAttachment
- MoneyFieldData
- Navigator
- Page
- ParseSpreadsheetOptions
- ParseSpreadsheetResponse
- RefItem
- ReportField
- ReportRef
- Role
- RoleField
- Row
- ServiceStatusInfo
- StaticApplicationFieldData
- StatusField
- TAccount
- TClientEvent
- TDate
- TDatetime
- TDuration
- TEmail
- TEnum
- TFullName
- TMoney
- TPhone
- TReport
- TStatus
- TTable
- TTime
- TTimezone
- TTimezones
- TableField
- UserField
- UserFieldData
- ValidationResult
- Watermark
- WidgetRefWithValues
- ReplacementTypeEnumBase
- RoleType
- TApplication
- TBoolean
- TCategory
- TFile
- TFloat
- TImage
- TJSON
- TLink
- TOAuth2
- TRole
- TString
- TUser
- Global constants
- Work with apps
- Web requests
- Access permissions
- Document flow
- Live Chats
- “Code” widget
- Signatures
- Business calendars
- Integration with IP telephony
- Integration with email marketing services
Money
The constructors are as follows:
new Money(float: number): TMoney<'XXX'>; new Money<C extends CurrencyCode>(float: number, currency: C): TMoney<C>;
When working with scripts, it is preferable to use the
constructor that specifies a particular currency:
const price = new Money(100.5, 'EUR');
Currency codes correspond to the [ISO 4217] standard (https://en.wikipedia.org/wiki/ISO_4217). Values of this type are immutable, so mutation methods return the updated value without changing the original one.
const price = new Money(100.5, 'EUR'); const total = price.multiply(count);
Type parameters
C: CurrencyCode
Hierarchy
Properties
Readonly cents
Number of cents.
Readonly currency
Currency (alphabetic code from the ISO 4217 standard).
Methods
add Deprecated
Adding money values.
Use TMoney.addm that guarantees precise calculations and checks whether currencies match.
Use TMoney.addm that guarantees precise calculations and checks whether currencies match.
Parameters
money: TMoney<C | "XXX">
Returns TMoney<C>
addm
Adding money values with guaranteed precision.
To avoid rounding errors, it is checked whether the currencies are different before the operation is executed. If the currencies don’t match, the operation doesn’t proceed, and an error is returned. Example:
const a = new Money(100.25, 'USD'); const b = new Money(200.75, 'USD'); const result = a.addm(b); // 301.00 USD
Error — If currencies don’t match.
Parameters
money: TMoney<C | "XXX">
Returns TMoney<C>
asFloat
Decimalization with an accuracy depending on the currency.
const salary = new Money(101, 'USD'); const salary2 = salary. multiply(0,001); salary2.asFloat(); // 0.1
Returns number
multiply
Multiply by the number, rounding down the cents.
Parameters
k: number
Returns TMoney<C>
Properties
Methods
Feedback sent successfully
Thank you for your input