Missing documentation for `decimals` in `sap.ui.core.format.FileSizeFormat`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
OpenUI5 version: 1.120.2
Browser/version (+device/version):
Any other tested browsers/devices(OK/FAIL):
URL (minimal example if possible):
- Online example: https://sapui5.hana.ondemand.com/sdk/docs/topics/24f340bdd59e4428aab30a20d14e2ebc.html
- API: https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.core.format.FileSizeFormat%23methods/sap.ui.core.format.FileSizeFormat.getInstance
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
What is the expected result?
What happens instead?
Any other information? (attach screenshot if possible)
For context, I am working on a UI5 project in typescript.
I want to format file size into 2 decimal places, so I referenced the online example:
I typed FileSizeFormat.getInstance({ decimals: 2 }).format(1048576) into my code. But I got the error:
I have to suppress the Typescript warning by adding this line:
// @ts-expect-error decimals parameter is not documented in UI5 constructor
I know that decimals: 2 works, because without it, the file size gets formatted to 1.048576 MB. But when I include it, the file size is correctly formatted to 1.05 MB. This might be a simple missing documentation issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.