heisenbugltd / si_units Goto Github PK
View Code? Open in Web Editor NEWUtility library to pretty print physical values in proper metric units
Home Page: https://github.heisenbug.eu/si_units/
License: Do What The F*ck You Want To Public License
Utility library to pretty print physical values in proper metric units
Home Page: https://github.heisenbug.eu/si_units/
License: Do What The F*ck You Want To Public License
I have no idea what's going on, but the ubuntu-lts
and debian-stable
images get stuck in the compilation.
Currently we treat a duration the same way as any other unit. While this is fine for duration values less than 1000 seconds or so, it easily becomes unusual, or even unreadable once we start prefixing seconds to express kilo seconds or even Mega seconds (i.e. 1 hour would be expressed as 3.6 ks
, one day is 86.4 ks
, and one year is about 31.5 Ms
). Though technically correct this is not how humans usually express such values.
If you specify Aft => 0 in the Image subprograms, it prints "0.6 " instead of the expected "600 m", because even with Aft = 0, there is at least one digit after the decimal point.
Problem
Right now, SI_Units uses strings encoded in iso-8859-1 (i.e. Ada.Characters.Latin_1
), which is fine for most purposes. One drawback is that we do not support the Ohm-sign (i.e. Greek Letter Omega). This can be worked around by simply providing your own unit name when instantiating any of the Image functions.
Proposed solution
It would be nice to directly support UTF-8 encoded character strings in SI_Units.Names
and subsequent use.
Implementation effort
The actual string concatenation within the library is agnostic to the string content itself, so the whole change should in effect be just be a matter of declaring the returned string as Ada.Strings.UTF_Encoding.UTF_8_String
to declare the intent and adding the changing the string used for the Ohm symbol in SI_Units.Names
.
Expected impact
Mostly documenation, library users should be made aware that the encoding is generally UTF-8. As this is a subtype of String, no code compatibility issues to previous versions are expected.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.