Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Format a Quantity as a human-readable string
ResourceFunction["QuantityToSimpleString"][quantity] formats quantity as a human-readable string. |
Format a Quantity as a simple String:
| In[1]:= |
| Out[1]= |
Format a currency with proper padding:
| In[2]:= |
| Out[2]= |
Format a Quantity with an improper fraction:
| In[3]:= |
| Out[3]= |
Format a Quantity with combined units:
| In[4]:= |
| Out[4]= |
Use None to format a bare unit:
| In[5]:= |
| Out[5]= |
Format quantities in a wide variety of units and magnitudes:
| In[6]:= | ![]() |
| Out[6]= | ![]() |
QuantityToSimpleString automatically handles singular and plural unit names:
| In[7]:= | ![]() |
| Out[7]= |
Compare QuantityToSimpleString (shown in black) to ToString (shown in red) and TextString (shown in blue):
| In[8]:= | ![]() |
| Out[8]= | ![]() |
Special characters appear for scientific notation:
| In[9]:= |
| Out[9]= |
Special characters also appear for symbolic magnitudes:
| In[10]:= |
| Out[10]= |
This work is licensed under a Creative Commons Attribution 4.0 International License