Comments (4)
There are a lot of units that can be converted from a string but aren't displayed in an equivalent fashion.
addUserDefinedUnit("arbitraryunit", units::unit_from_string("arbitraryunit"));
should work, or whatever string you do, though that particular piece of code would only work once.
I am also thinking to add an addUserDefinedOutputUnit
for cases like this as well in the near future.
from units.
Ok. Maybe I'm biased because arbitrary unit is relatively important for us.
We have our own mechanism for handling user defined units as mentioned in #271. I opened this issue because we would prefer to avoid adding special handling to always enforce a certain formatting of CXCUN[1]
. But I see your point
from units.
Fair enough, easy enough to add output units like this in the tables for units that don't interfere with existing ones. Feel free to make a PR adding it, or just let me know what string you want and I will add it next I am tinkering with that part of the code. It would go in defined_unit_names_si
then you just have to adjust the array size.
from units.
Looking at https://en.wikipedia.org/wiki/Arbitrary_unit#Abbreviations_and_nomenclature, I would suggest to use "arb. unit", as it is the least ambiguous?
from units.
Related Issues (20)
- Conan package HOT 12
- Convert to inverse unit incorrect HOT 1
- Issues with parsing single-letter prefixes such as for `atto` HOT 7
- CleanUnitString breaks on 0.2 and 0.3 HOT 1
- Strange choice of units in to_string HOT 6
- Your units conversion service seems to be down... HOT 11
- "kg m" is parsed as "kg" HOT 1
- Surprising parse results with `.` and `-` HOT 4
- Question about to_string() function HOT 8
- Degrees celsius get converted to Kelvin in operations HOT 6
- Function to remove a single user defined unit HOT 2
- Try to start a PR for adding support for KPa, MPa, GPa but permission denied HOT 3
- Using to_string for scalars causes crashes HOT 2
- Use of uninitialised memory in unit maps HOT 7
- "Stress testing" units' string parsing HOT 8
- Favoring SI base units in string formatting? HOT 3
- to_string strange output HOT 4
- expression did not evaluate to a constant HOT 4
- Unary negation of measurements HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from units.