Docs review 3.4.0

This commit is contained in:
Eugenio Romano
2019-08-05 16:59:34 +01:00
parent 78e60a4da4
commit 3767c5d8de
17 changed files with 168 additions and 72 deletions

View File

@@ -1,4 +1,11 @@
# [Decimal Number Pipe](../../../lib/core/pipes/decimal-number.pipe.ts "Defined in multi-value.pipe.ts")
---
Title: Decimal Number Pipe
Added: v3.4.0
Status: Active
Last reviewed: 2019-08-05
---
# [Decimal Number Pipe](../../../lib/core/pipes/decimal-number.pipe.ts "Defined in decimal-number.pipe.ts")
Transforms a number to have a certain amount of digits in its integer part and also in its decimal part.
@@ -6,10 +13,10 @@ Transforms a number to have a certain amount of digits in its integer part and a
### Properties
| Name | Type | Default value | Description |
| ---------- | ---------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------- |
| digitsInfo | [DecimalNumberModel](../../../lib/core/models/decimal-number.model.ts) | | A format to apply to the date value. [Date Pipe Formats.](https://angular.io/api/common/DatePipe#custom-format-options) |
| locale | string | 'en-US' | A locale id for the locale format rules to use. |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| digitsInfo | [`DecimalNumberModel`](../../../lib/core/models/decimal-number.model.ts) | | A format to apply to the date value. [Date Pipe Formats.](https://angular.io/api/common/DatePipe#custom-format-options) |
| locale | string | 'en-US' | A locale id for the locale format rules to use. |
## Details
@@ -23,7 +30,7 @@ This pipe transforms a given number so it follows the set configuration for the
}
```
You can also overwrite this config by passing a [DecimalNumberModel](../../../lib/core/models/decimal-number.model.ts) as an argument for this pipe.
You can also overwrite this config by passing a [`DecimalNumberModel`](../../../lib/core/models/decimal-number.model.ts) as an argument for this pipe.
The number can be also localized so it applies commas and dots in the right place depending on the locale id in use.

View File

@@ -33,7 +33,7 @@ The pipe takes a date and formats it and localizes it so the date is displayed i
To localize the dates in your application, you will need to add the specific locale file for your region in order to use it. Read more about internationalization [here](https://angular.io/guide/i18n#i18n-pipes).
For example, if you want add the japanese date localization in your ADF app you can add in your ```app.module.ts```:
For example, if you want add the japanese date localization in your ADF app you can add in your `app.module.ts`:
```typescript
import { AppConfigService, TRANSLATION_PROVIDER, DebugAppConfigService, CoreModule, CoreAutomationService } from '@alfresco/adf-core';
@@ -45,13 +45,11 @@ import { registerLocaleData } from '@angular/common';
import localeJa from '@angular/common/locales/ja';
registerLocaleData(localeJa);
```
### Default values
You can overwrite the default values of this pipe by adding these properties to your ```app.config.json```:
You can overwrite the default values of this pipe by adding these properties to your `app.config.json`:
```json
"dateValues": {
@@ -67,4 +65,4 @@ You can overwrite the default values of this pipe by adding these properties to
| defaultDateTimeFormat | string | The format to apply to date-time values |
| defaultLocale | string | The locale id to apply |
This configuration overwrites the values in the localized date pipe as well as other components to have more consistency across your app. However, you can still overwrite these values any time by using the pipe in your code.
This configuration overwrites the values in the [localized date pipe](../../core/pipes/localized-date.pipe.md) as well as other components to have more consistency across your app. However, you can still overwrite these values any time by using the pipe in your code.