Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

QuantityValue<T>.Value Property

Gets or sets a numerical value of the quantity expressed in the base measurement unit of the specified type.

Namespace: DevExpress.UnitConversion

Assembly: DevExpress.Docs.v24.2.dll

NuGet Package: DevExpress.Document.Processor

#Declaration

public double Value { get; set; }

#Property Value

Type Description
Double

A Double value of the quantity.

#Remarks

The Value gets or sets a value in the base measurement unit, i.e., the first unit in the inner conversion table. To use the quantity values correctly, set the numerical value using one of the extension functions as illustrated in the following code snippet:

using DevExpress.UnitConversion;
//...
// The height is 5'4".
QuantityValue<Distance> height = (5.0).Feet() + (4.0).Inches();
string s = String.Format("The height is {0} ells or {1} meters.",
    height.ToElls().Value.ToString("g3"), height.ToMeters().Value.ToString("g3"));
MessageBox.Show(s);
See Also