Skip to content

Commit f204ebf

Browse files
committed
feat: Add format options to llm guidelines
1 parent f2ade83 commit f204ebf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

resources/guidelines.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
```
4545
- Find more information on the UI5 documentation page "Declarative API for Initial Components"
4646
- **ALWAYS** use data binding in views to connect UI controls to data or i18n models.
47-
- When binding data from OData services, **NEVER** use custom formatters for standard data types (e.g., dates, numbers, currencies). The built-in types handle these cases automatically.
47+
- **ALWAYS** prefer built-in data types with format options for formatting in data binding:
48+
1. Built-in Data Types with Format Options: Use built-in data types (e.g., `sap.ui.model.type.Integer`, `sap.ui.model.type.Currency`) with `formatOptions` to handle standard formatting needs. For OData models, the types in the odata namespace are used (e.g., `sap.ui.model.odata.type.Decimal`).
49+
- Example: `sap.ui.model.type.Integer` with `formatOptions: {groupingEnabled: true}` for number formatting with thousands separator.
50+
2. Custom Formatters: Only write custom formatter functions for unique business logic that cannot be handled by built-in data types and their format options.
51+
- This applies to **ALL** data sources (OData models, JSON models, etc.). Built-in data types can handle standard data types (dates, numbers, currencies, etc.) and should always be preferred over custom solutions.
4852
- When making changes to `*.properties` files, **ALWAYS** apply the changes to all relevant locales. This ensures consistency across different language versions of the application.
4953
- **Example:** If you add a new key to `i18n.properties`, also add it to existing translation files like e.g `i18n_en.properties`, `i18n_de.properties`, etc.
5054
- **NEVER** use inline script in HTML

0 commit comments

Comments
 (0)