GithubHelp home page GithubHelp logo

Format arbitrary unit nicely about units HOT 4 CLOSED

llnl avatar llnl commented on July 25, 2024
Format arbitrary unit nicely

from units.

Comments (4)

phlptp avatar phlptp commented on July 25, 2024

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.

jl-wynen avatar jl-wynen commented on July 25, 2024

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.

phlptp avatar phlptp commented on July 25, 2024

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.

SimonHeybrock avatar SimonHeybrock commented on July 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.