NumberFormat Class

Provides Excel-compatible number format code rendering.

Inheritance

Object

Documents.Spreadsheet.NumberFormat

Namespace: Radzen.Documents.Spreadsheet

Assembly: Radzen.Blazor.dll

Syntax

public static class NumberFormat

Methods

AdjustDecimalslink

Adjusts the number of decimal places in a format code.

Declaration
public static string AdjustDecimals(string formatCode, int delta)
Parameters
Type Name Description
string formatCode
int delta
Returns
Type Description
string

Applylink

Applies a format code to a value and returns the formatted string. Returns null when the format is General/null (caller should fall back to default rendering).

Declaration
public static string Apply(string formatCode, object value, Documents.Spreadsheet.CellDataType type)
Parameters
Type Name Description
string formatCode
object value
Documents.Spreadsheet.CellDataType type
Returns
Type Description
string

ApplyWithColorlink

Applies a format code to a value and returns the formatted string and optional color. The color is determined by color codes in the format string (e.g., [Red], [Green]).

Declaration
public static ValueTuple<string, string> ApplyWithColor(string formatCode, object value, Documents.Spreadsheet.CellDataType type)
Parameters
Type Name Description
string formatCode
object value
Documents.Spreadsheet.CellDataType type
Returns
Type Description
ValueTuple<string, string>
In This Article
An error has occurred. This app may no longer respond until reloaded. Reload 🗙