Number Format
Facade API | Paid Version | Univer Server | Univer on Node.js | Preset |
---|---|---|---|---|
✅ | - | - | ✅ | UniverSheetsCorePreset |
The number format plugin provides the formatting function of numbers in cells, including the number of decimal places, thousands separator, currency symbol, etc.
🚨
The DBNum syntax is not supported.
Facade API
Set number format
const sheet = univerAPI.getActiveWorkbook().getActiveSheet();
// get range
const range = sheet.getRange(0, 0, 10, 10); // A1:J10
// For specific parameters, please refer to: https://support.microsoft.com/en-us/office/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68
range.setNumberFormat('#,###');