devexpress-office-file-api-unit-conversion

Convert between metric and US units of measurement in .NET applications using the DevExpress Unit Conversion API.

Updated Dec 11, 2025
One-click install
npx skills add https://github.com/AleksaRistic216/dotnet-playground --skill devexpress-office-file-api-unit-conversion-aleksaristic216
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: devexpress-office-file-api-unit-conversion
Source: https://github.com/AleksaRistic216/dotnet-playground/tree/main/.github/skills/office-file-api/devexpress-office-file-api-unit-conversion
Command: npx skills add https://github.com/AleksaRistic216/dotnet-playground --skill devexpress-office-file-api-unit-conversion-aleksaristic216

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires DevExpress.Document.Processor, and includes references (resource) components.

What problem does it solve? Writing unit conversion logic by hand in .NET requires maintaining conversion factors for distances, masses, temperatures, areas, volumes, and speeds, which is error-prone and hard to verify. This Skill provides the DevExpress Unit Conversion API patterns so you can perform type-safe conversions with a fluent syntax or direct scalar converter calls. ## Core Features & Use Cases - Fluent QuantityValue API: Create typed quantities like (5.0).Feet() + (4.0).Inches() and convert with ToMeters(), with implicit conversion to double for arithmetic and formatting. - Direct Units.Convert() API: Call Units.Distance.Convert(), Units.Temperature.Convert(), and similar converters for scalar or in-place batch array conversions without creating quantity objects. - Seven measurement categories: Distance, mass, temperature, area, volume, speed, and metric prefixes (kilo, mega, milli, etc.), all working identically on .NET 6+ and .NET Framework 4.6.2+. - Use Case: A logistics application needs to display shipment weights in pounds for US customers and kilograms for EU customers; use QuantityValue<Mass> with .Pounds() and .ToKilograms() to convert values at display time. ## Quick Start Install the DevExpress.Document.Processor NuGet package, add using DevExpress.UnitConversion, and ask the assistant to convert 100 degrees Celsius to Fahrenheit using Units.Temperature.Convert.

Frequently Asked Questions about devexpress-office-file-api-unit-conversion

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert units in C# with DevExpress?

Install the DevExpress.Document.Processor NuGet package and add using DevExpress.UnitConversion. Use fluent methods like (100.0).Meters().ToFeet() or call Units.Distance.Convert(100.0, Distance.Foot, Distance.Meter) for direct scalar conversion.

How do I convert Celsius to Fahrenheit in .NET?

Call Units.Temperature.Convert(100.0, Temperature.Celsius, Temperature.Fahrenheit) for a direct scalar result, or use the fluent pattern (100.0).Celsius().ToFahrenheit(). The Temperature enum also supports Kelvin, Rankine, and Reaumur.

Does the DevExpress Unit Conversion API work on .NET Framework?

Yes, the same code works on .NET 6, 7, 8+ and .NET Framework 4.6.2+ without modification. Install DevExpress.Document.Processor via NuGet or reference DevExpress.Docs.v25.2.dll directly, with a valid DevExpress license.

Why is Distance.Kilometer or Mass.Kilogram not found in the enum?

Kilometer and Kilogram are not direct enum values in this API. Use the .Kilometers() and .Kilograms() fluent extension methods instead, or use Units.Metric.Convert with MetricPrefix.Kilo to handle the prefix scaling.

How do I convert to square kilometers with the Area converter?

Area.SquareKilometer does not exist in the Area enum. Convert through Area.SquareMeter first, then divide by 1,000,000 to get square kilometers, or multiply by 1,000,000 when converting in the other direction.