From a67472c7257a27bdb7c856a29cfc74892c7b00f0 Mon Sep 17 00:00:00 2001 From: Mark Gardner Date: Mon, 28 May 2018 19:44:46 -0700 Subject: [PATCH] Added ability to calculate initial velocity based on projection angle and distance. Fixed kinetic energy calc doubling the correct value. Fixed JSON output bug. --- .env | 2 +- Justfile | 19 +- README.md | 138 +++-------- ballistic.go | 89 +++++-- src/github.com/runeimp/ballistic/constants.go | 10 +- src/github.com/runeimp/ballistic/parsing.go | 20 +- src/github.com/runeimp/locale/numbers.go | 219 +----------------- 7 files changed, 145 insertions(+), 352 deletions(-) diff --git a/.env b/.env index b2a0814..fd27449 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ GOPATH=/Users/runeimp/dev/apps/ballistic -VERSION=0.4.2 \ No newline at end of file +VERSION=0.5.0 \ No newline at end of file diff --git a/Justfile b/Justfile index 68caf8c..cdabdb2 100644 --- a/Justfile +++ b/Justfile @@ -20,6 +20,9 @@ _build-app: just build-win32 else just build-{{os()}} + if [ -d "${HOME}/dev/bin" ]; then + cp bin/{{os()}}/ballistic "${HOME}/dev/bin/" + fi fi @build arg='app': @@ -234,9 +237,9 @@ _list-dir path='.': # Run the app -run +args='': - @just term-wipe - @just _run {{args}} +@run +args='': + just term-wipe + just _run {{args}} @_run +args='': # BALLISTIC_WEIGHT=grams bin/{{os()}}/ballistic @@ -306,15 +309,15 @@ _term-lw label: term-wipe: #!/usr/bin/env sh if [ '{{os()}}' = 'macos' ]; then - just _term-wipe + osascript -e 'tell application "System Events" to keystroke "k" using command down' + elif [ -f `which tput` ]; then + tput reset + elif [ -f `which reset` ]; then + reset else just _term-clear fi -_term-wipe: - #!/usr/bin/osascript - tell application "System Events" to keystroke "k" using command down - # Test all examples test: diff --git a/README.md b/README.md index 40bf5ca..6522f37 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Ballistic v0.4.2 +Ballistic v0.5.0 ================ Command line ballistics calculator @@ -66,6 +66,28 @@ $ ballistic --mass 42g --draw-weight 80lb --draw-length 0.72m --json --pretty } ``` +### Calculate initial velocity and MPBR based on projection angel and distance (on a horizontal plan) + +```text +$ ballistic -a 45 -d 100m + + Projectile Velocity: 790.133355 meters per second +Max Point Blank Range: 239.365366 meters + +``` + +#### Calculate everything by adding projectile mass + +```text +$ ballistic -a 45 -d 100m -m 300gr + + Projectile Velocity: 790.133355 meters per second + Projectile Energy: 6,068.197170 joules + Projectile Momentum: 15.359932 meter kilogram per second +Max Point Blank Range: 239.365366 meters + +``` + ### Help Info ```text @@ -78,10 +100,10 @@ USAGE: ballistic [global options] VERSION: - 0.4.2 + 0.5.0 GLOBAL OPTIONS: - --debug, -d Output debug info + --debug, -D Output debug info --draw-length LENGTH, --length LENGTH, -l LENGTH Bow or sling shot draw LENGTH. Used to calculate projectile velocity, energy, etc. --draw-weight WEIGHT, --weight WEIGHT, -w WEIGHT Bow or sling shot draw WEIGHT. Used to calculate projectile velocity, energy, etc. --json, -j Output JSON data @@ -89,6 +111,8 @@ GLOBAL OPTIONS: --precision PRECISION, --float PRECISION, -f PRECISION The output floating point PRECISION (numbers after decimal mark). (default: "6") --pretty-print, --pretty, -p Pretty printed JSON output --projectile MASS, --mass MASS, -m MASS Projectile MASS (weight). Used to calculate projectile velocity, energy, etc. + --projectile-range value, --distance value, -d value The distance the projectile traveled + --projection-angle value, --angle value, -a value The projection angle or trajectory of projectile --radius RADIUS, -r RADIUS The RADIUS of the target area. Used to calculate MPBR (Maximum Point Blank Range). (default: "225mm") --velocity VELOCITY, -v VELOCITY The projectile VELOCITY (speed). Used to calculate projectile energy, momentum, etc. --help, -h Output this help info @@ -97,6 +121,9 @@ GLOBAL OPTIONS: VALUE SUFFIXES: All input values may be suffixed to allow for broader input selection. + ANGEL + d, deg, degree, degrees + r, rad, radian, radians LENGTH c, cm, centi, centimeter, centimeters f, ft, foot, feet @@ -143,7 +170,7 @@ This is my choice over using `make` to facilitates building the binaries and cre Internationalization/Locale --------------------------- -Ballistic can format the human output numbers per locale norms. It currently checks for locale settings via the environment variables LC_CTYPE and LANG. It also allows you to specify a locale such as `en_CA` or `FR-CA` for English or French Canada for instance or simply `EN` for general English speakers, `DE` the German language or country, etc. via the `--locale` option. +Ballistic can format the human output numbers per locale norms. It currently checks for locale settings via the environment variables `LC_CTYPE` and `LANG`. It also allows you to specify a locale such as `en_CA` or `FR-CA` for English or French Canada for instance or simply `EN` for general English speakers, `DE` the German language or country, etc. via the `--locale` option. ### Locales Supported @@ -190,112 +217,11 @@ Here be Dragons! (my research) - [SI (International System of Units) - Wikipedia][] -### Symbols - -| Category | Symbol | Unicode | Decimal | Escape | Numbers | Description | -| :------: | :----: | :-----: | :-----: | :----: | :-----: | ----------- | -| Comma | ' | U+0027 | `'` | `\u0027` | | [Unicode APOSTROPHE][] | -| Comma | , | U+002C | `,` | `\u002C` | ✓ | [Unicode COMMA][] | -| Comma | 𑑍 | U+01144D | `𑑍` | `\u01144D` | | [Unicode NEWA COMMA][] | -| Comma | 𝪇 | U+01DA87 | `𝪇` | `\u01DA87` | | [Unicode SIGNWRITING COMMA][] | -| Comma | ʽ | U+02BD | `ʽ` | `\u02BD` | | [Unicode MODIFIER LETTER REVERSED COMMA][] | -| Comma | ̒ | U+0312 | `̒` | `\u0312` | | [Unicode COMBINING TURNED COMMA ABOVE][] | -| Comma | ̔ | U+0314 | `̔` | `\u0314` | | [Unicode COMBINING REVERSED COMMA ABOVE][] | -| Comma | ̕ | U+0315 | `̕` | `\u0315` | | [Unicode COMBINING COMMA ABOVE RIGHT][] | -| Comma | ، | U+060C | `،` | `\u060C` | | [Unicode ARABIC COMMA][] | -| Comma | ❛ | U+275B | `❛` | `\u275B` | | [Unicode HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT][] | -| Comma | ❜ | U+275C | `❜` | `\u275C` | | [Unicode HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT][] | -| Comma | ⸲ | U+2E32 | `⸲` | `\u2E32` | | [Unicode TURNED COMMA][] | -| Comma | ⸴ | U+2E34 | `⸴` | `\u2E34` | | [Unicode RAISED COMMA][] | -| Comma | ⹁ | U+2E41 | `⹁` | `\u2E41` | | [Unicode REVERSED COMMA][]. Used in Sindhi. | -| Comma | 、 | U+3001 | `、` | `\u3001` | | [Unicode IDEOGRAPHIC COMMA][] | -| Comma | ﹐ | U+FE50 | `﹐` | `\uFE50` | | [Unicode SMALL COMMA][] | -| Comma | ﹑ | U+FE51 | `﹑` | `\uFE51` | | [Unicode SMALL IDEOGRAPHIC COMMA][] | -| Comma | , | U+FF0C | `,` | `\uFF0C` | | [Unicode FULLWIDTH COMMA][] | -| Comma | 、 | U+FF64 | `、` | `\uFF64` | | [Unicode HALFWIDTH IDEOGRAPHIC COMMA][] | -| Decimal Mark | ٫ | U+066B | `٫` | `\u066B` | ✓ | [Unicode ARABIC DECIMAL SEPARATOR][] | -| Decimal Mark | ⎖ | U+2396 | `⎖` | `\u2396` | Keyboard | [Unicode DECIMAL SEPARATOR KEY SYMBOL][]. Noted in [ISO/IEC 9995][ISO/IEC 9995 - Wikipedia] | -| Decimal Mark? | ⸰ | U+2E30 | `⸰` | `\u2E30` | | [Unicode RING POINT][] | -| Group Mark | ٬ | U+066C | `٬` | `\u066C` | ✓ | [Unicode ARABIC THOUSANDS SEPARATOR][] | -| Interpunct | · | U+00B7 | `·` | `\u00B7` | ✓ | [Unicode MIDDLE DOT][] | -| Interpunct | • | U+2022 | `•` | `\u2022` | | [Unicode BULLET][] | -| Interpunct | ‣ | U+2023 | `‣` | `\u2023` | | [Unicode TRIANGULAR BULLET][] | -| Interpunct | ∙ | U+2219 | `∙` | `\u2219` | | [Unicode BULLET OPERATOR][] | -| Interpunct | ⋅ | U+22C5 | `⋅` | `\u22C5` | | [Unicode DOT OPERATOR][] | -| Interpunct | ◦ | U+25E6 | `◦` | `\u25E6` | | [Unicode WHITE BULLET][] | -| Interpunct | ⦁ | U+2981 | `⦁` | `\u2981` | Math | [Unicode Z NOTATION SPOT][] | -| Interpunct | ⸱ | U+2E31 | `⸱` | `\u2E31` | | [Unicode WORD SEPARATOR MIDDLE DOT][] | -| Misc. | 🍀 | U+1F340 | `🍀` | `\u1F340` | | [Unicode FOUR LEAF CLOVER][] | - - - - - -### Formulas - -Note: These formulas are here for my tracking purposes. They are not necessarily used in the app. - -``` -PE = mass * gravity * height - -Energy = pressure * volume / efficiency -``` - -PE = Potential Energy - - -- [PSI to Energy][] - - - [`just`]: https://github.com/casey/just [Decimal Separator - Wikipedia]: https://en.wikipedia.org/wiki/Decimal_separator -[ISO/IEC 9995 - Wikipedia]: https://en.wikipedia.org/wiki/ISO/IEC_9995 [Decimal and Thousands Separators (International Language Environments Guide)]: https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/ [SI (International System of Units) - Wikipedia]: https://en.wikipedia.org/wiki/International_System_of_Units [ISO 31-0: Numbers - Wikipedia]: https://en.wikipedia.org/wiki/ISO_31-0#Numbers -[PSI to Energy]: https://www.physicsforums.com/threads/psi-to-kw-conversion.700882/ -[Unicode APOSTROPHE]: https://www.fileformat.info/info/unicode/char/0027/ -[Unicode ARABIC COMMA]: https://www.fileformat.info/info/unicode/char/060C/ -[Unicode ARABIC DECIMAL SEPARATOR]: https://www.fileformat.info/info/unicode/char/066B/ -[Unicode ARABIC THOUSANDS SEPARATOR]: https://www.fileformat.info/info/unicode/char/066C/ -[Unicode BULLET OPERATOR]: https://www.fileformat.info/info/unicode/char/2219/ -[Unicode BULLET]: https://www.fileformat.info/info/unicode/char/2022/ -[Unicode COMBINING COMMA ABOVE RIGHT]: https://www.fileformat.info/info/unicode/char/0315/ -[Unicode COMBINING REVERSED COMMA ABOVE]: https://www.fileformat.info/info/unicode/char/0314/ -[Unicode COMBINING TURNED COMMA ABOVE]: https://www.fileformat.info/info/unicode/char/0312/ -[Unicode COMMA]: https://www.fileformat.info/info/unicode/char/002C/ -[Unicode DECIMAL SEPARATOR KEY SYMBOL]: https://www.fileformat.info/info/unicode/char/2396/ -[Unicode DOT OPERATOR]: https://www.fileformat.info/info/unicode/char/22C5/ -[Unicode FOUR LEAF CLOVER]: https://www.fileformat.info/info/unicode/char/1F340/ -[Unicode FULLWIDTH COMMA]: https://www.fileformat.info/info/unicode/char/FF0C/ -[Unicode HALFWIDTH IDEOGRAPHIC COMMA]: https://www.fileformat.info/info/unicode/char/FF64/ -[Unicode HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT]: https://www.fileformat.info/info/unicode/char/275C/ -[Unicode HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT]: https://www.fileformat.info/info/unicode/char/275B/ -[Unicode IDEOGRAPHIC COMMA]: https://www.fileformat.info/info/unicode/char/3001/ -[Unicode MIDDLE DOT]: https://www.fileformat.info/info/unicode/char/00B7/ -[Unicode MODIFIER LETTER REVERSED COMMA]: https://www.fileformat.info/info/unicode/char/02BD/ -[Unicode NEWA COMMA]: https://www.fileformat.info/info/unicode/char/1144D/ -[Unicode RAISED COMMA]: https://www.fileformat.info/info/unicode/char/2E34/ -[Unicode REVERSED COMMA]: https://www.fileformat.info/info/unicode/char/2E41/ -[Unicode RING POINT]: https://www.fileformat.info/info/unicode/char/2E30/ -[Unicode SIGNWRITING COMMA]: https://www.fileformat.info/info/unicode/char/1DA87/ -[Unicode SMALL COMMA]: https://www.fileformat.info/info/unicode/char/FE50/ -[Unicode SMALL IDEOGRAPHIC COMMA]: https://www.fileformat.info/info/unicode/char/FE51/ -[Unicode TRIANGULAR BULLET]: https://www.fileformat.info/info/unicode/char/2023/ -[Unicode TURNED COMMA]: https://www.fileformat.info/info/unicode/char/2E32/ -[Unicode WHITE BULLET]: https://www.fileformat.info/info/unicode/char/25E6/ -[Unicode WORD SEPARATOR MIDDLE DOT]: https://www.fileformat.info/info/unicode/char/2E31/ -[Unicode Z NOTATION SPOT]: https://www.fileformat.info/info/unicode/char/2981/ + diff --git a/ballistic.go b/ballistic.go index e332fda..0148e8e 100644 --- a/ballistic.go +++ b/ballistic.go @@ -33,7 +33,7 @@ import ( // // CONSTANTS // -const APP_VERSION = "0.4.2" +const APP_VERSION = "0.5.0" // @@ -46,7 +46,9 @@ type BallisticData struct { mpbr ParsedData // max_point_blank_range ParsedData projectile_energy ParsedData projectile_mass ParsedData + projectile_range ParsedData projectile_velocity ParsedData + projection_angle ParsedData target_radius ParsedData } @@ -54,7 +56,7 @@ type BallisticData struct { type LabeledValue struct { Label string `json:"label,omitempty"` ValueFloat float64 `json:"value,omitempty"` - ValueString string `json:"value,omitempty"` + ValueString string `json:"value_str,omitempty"` } // func (t LabeledValue) MarshalJSON() ([]byte, error) { @@ -94,7 +96,7 @@ func buildOutputData(data BallisticData) { output.Velocity = velocity_to_velocity(data) } - output.Energy = calcEnergy(data) + output.Energy = calcKineticEnergy(data) output.Momentum = calcMomentum(data) if output_debug { @@ -152,19 +154,19 @@ func calcDistanceForDrop(drop, velocity float64) (distance float64) { } -/** Calculate energy */ -func calcEnergy(data BallisticData) (energy LabeledValue) { +/** Calculate kinetic energy */ +func calcKineticEnergy(data BallisticData) (energy LabeledValue) { // 1 Joule == 1 N⋅m (Newton meter) mass_kg := data.projectile_mass.Value velocity_mps := data.projectile_velocity.Value - energy.ValueFloat = mass_kg * velocity_mps * velocity_mps + energy.ValueFloat = mass_kg * velocity_mps * velocity_mps * 0.5 energy.Label = ENERGY_LABEL_JOULES if output_debug { - log.Printf("calcEnergy() <| mass: %f kg", mass_kg) - log.Printf("calcEnergy() <| velocity: %f mps", velocity_mps) - log.Printf("calcEnergy() | energy: %f %s", energy.ValueFloat, energy.Label) + log.Printf("calcKineticEnergy() <| mass: %f kg", mass_kg) + log.Printf("calcKineticEnergy() <| velocity: %f mps", velocity_mps) + log.Printf("calcKineticEnergy() | energy: %f %s", energy.ValueFloat, energy.Label) } return energy @@ -172,13 +174,13 @@ func calcEnergy(data BallisticData) (energy LabeledValue) { /** Calculate force Newtons */ -func calc_force(avg_draw_weight float64) (draw_force ParsedData) { +func calcForce(avg_draw_weight float64) (draw_force ParsedData) { draw_force.Value = avg_draw_weight * FORCE_FROM_KILOGRAMS_TO_NEWTONS draw_force.Label = FORCE_LABEL_NEWTONS if output_debug { - log.Printf("calc_force() <| avg_draw_weight: %f kg", avg_draw_weight) - log.Printf("calc_force() | draw_force: %f %s", draw_force.Value, draw_force.Label) + log.Printf("calcForce() <| avg_draw_weight: %f kg", avg_draw_weight) + log.Printf("calcForce() | draw_force: %f %s", draw_force.Value, draw_force.Label) } return draw_force @@ -287,6 +289,30 @@ func calcVelocity(data BallisticData) (projectile_velocity ParsedData) { } +/** Calculate the initial velocity of a projectile */ +func calcVelocityInitial(data BallisticData) (initial_velocity ParsedData) { + radians := data.projection_angle.Value * ANGLE_DEGREES_TO_RADIANS + sin := math.Sin(2 * radians) + Rg := data.projectile_range.Value * GRAVITY_MPS + initial_velocity.Value = math.Sqrt(Rg/sin) + initial_velocity.Label = VELOCITY_LABEL_MPS + + if len(InputData.Velocity) == 0 { + if InputData.Metric { + InputData.Velocity = VELOCITY_LABEL_MPS + } else { + InputData.Velocity = VELOCITY_LABEL_FPS + } + } + + if output_debug { + log.Printf("calcVelocityInitial() | initial velocity: %15.6f mps", initial_velocity.Value) + } + + return initial_velocity +} + + /** * Cleans up OutputData for JSON parsing * @@ -294,8 +320,9 @@ func calcVelocity(data BallisticData) (projectile_velocity ParsedData) { * This is necessary because the standard JSON package does not check child * structs if they are empty or not. */ -func cleanupJSON(data OutputData) (data_obj map[string]interface{}) { - data_obj = make(map[string]interface{}) +func cleanupJSON(data OutputData) (data_obj map[string]LabeledValue) { + // data_obj = make(map[string]interface{}) + data_obj = make(map[string]LabeledValue) if data.Energy.ValueFloat != 0 { data_obj["energy"] = data.Energy @@ -320,7 +347,9 @@ var locale_NumberFormatter func(number float64, scale int) string /** Returns the largest integer in the list of arguments */ func maxInt(nums ...int) (max_int int) { - max_int = math.MinInt64 + // max_int = math.MinInt64 // ./ballistic.go:350:10: constant -9223372036854775808 overflows int when compiling for Win32 + max_int = math.MinInt32 + for _, num := range nums { if max_int < num { max_int = num @@ -444,12 +473,22 @@ func outputJSON(data OutputData) { if output_debug { fmt.Println("JSON data!") fmt.Printf("data.Energy: %f %s\n", data.Energy.ValueFloat, data.Energy.Label) + fmt.Printf("data.Momentum: %f %s\n", data.Momentum.ValueFloat, data.Momentum.Label) + fmt.Printf("data.Mpbr: %f %s\n", data.Mpbr.ValueFloat, data.Mpbr.Label) + fmt.Printf("data.Velocity: %f %s\n", data.Velocity.ValueFloat, data.Velocity.Label) } var err error var json_data []byte data_obj := cleanupJSON(data) // data_obj := data + if output_debug { + fmt.Println("JSON data!") + fmt.Printf("data_obj[\"energy\"]: %f %s\n", data_obj["energy"].ValueFloat, data_obj["energy"].Label) + fmt.Printf("data_obj[\"momentum\"]: %f %s\n", data_obj["momentum"].ValueFloat, data_obj["momentum"].Label) + fmt.Printf("data_obj[\"mpbr\"]: %f %s\n", data_obj["mpbr"].ValueFloat, data_obj["mpbr"].Label) + fmt.Printf("data_obj[\"velocity\"]: %f %s\n", data_obj["velocity"].ValueFloat, data_obj["velocity"].Label) + } if output_pretty { json_data, err = json.MarshalIndent(data_obj, "", output_indent) @@ -530,10 +569,18 @@ func main() { app.Version = APP_VERSION app.Flags = []cli.Flag { + cli.StringFlag{ + Name: "projection-angle, angle, a", + Usage: "The projection angle or trajectory of projectile", + }, cli.BoolFlag{ - Name: "debug, d", + Name: "debug, D", Usage: "Output debug info", }, + cli.StringFlag{ + Name: "projectile-range, distance, d", + Usage: "The distance the projectile traveled", + }, cli.StringFlag{ Name: "draw-weight, weight, w", Usage: "Bow or sling shot draw `WEIGHT`. Used to calculate projectile velocity, energy, etc.", @@ -663,7 +710,7 @@ func main() { if len(c.String("draw-weight")) > 0 { data.draw_weight = ParseValue(c.String("draw-weight"), VALUE_TYPE_MASS) avg_draw_weight := data.draw_weight.Value * 0.5 - data.draw_force = calc_force(avg_draw_weight) + data.draw_force = calcForce(avg_draw_weight) } if len(c.String("velocity")) > 0 { data.projectile_velocity = ParseValue(c.String("velocity"), VALUE_TYPE_VELOCITY) @@ -671,10 +718,18 @@ func main() { if len(c.String("mass")) > 0 { data.projectile_mass = ParseValue(c.String("mass"), VALUE_TYPE_MASS) } + if len(c.String("projectile-range")) > 0 { + data.projectile_range = ParseValue(c.String("projectile-range"), VALUE_TYPE_LENGTH) + } + if len(c.String("projection-angle")) > 0 { + data.projection_angle = ParseValue(c.String("projection-angle"), VALUE_TYPE_MASS) + } if data.projectile_velocity.Value == 0 { if data.projectile_mass.Value > 0 && data.draw_length.Value > 0 && data.draw_force.Value > 0 { data.projectile_velocity = calcVelocity(data) + } else if data.projectile_range.Value > 0 && data.projection_angle.Value > 0 { + data.projectile_velocity = calcVelocityInitial(data) } } diff --git a/src/github.com/runeimp/ballistic/constants.go b/src/github.com/runeimp/ballistic/constants.go index 9810add..898da52 100644 --- a/src/github.com/runeimp/ballistic/constants.go +++ b/src/github.com/runeimp/ballistic/constants.go @@ -55,6 +55,9 @@ COPYRIGHT: VALUE SUFFIXES: All input values may be suffixed to allow for broader input selection. + ANGEL + d, deg, degree, degrees + r, rad, radian, radians LENGTH c, cm, centi, centimeter, centimeters f, ft, foot, feet @@ -90,6 +93,10 @@ If most or all of the input values are in imperial units then the output will us // The environment variable BALLISTIC_UNITS can be defined as imperial or metric. If it is defined the output units will always be of that system. If BALLISTIC_UNITS is not defined and most or all of the input values are in imperial units then the output will use imperial units as well. Otherwise ballistic defaults to metric. +const ANGLE_DEGREES_TO_RADIANS float64 = 0.0174533 +const ANGLE_LABEL_DEGREES = "degrees" +const ANGLE_LABEL_RADIANS = "radians" + const LENGTH_FROM_CENTIMETERS_TO_METERS float64 = 0.01 const LENGTH_FROM_FEET_TO_METERS float64 = 0.3048 const LENGTH_FROM_INCHES_TO_CM float64 = 2.54 @@ -164,9 +171,10 @@ const VELOCITY_LABEL_MPS = "meters per second" var /* const */ VALUE_RE = regexp.MustCompile("([0-9]*[0-9.]?[0-9]*)([a-z#]*)") // var /* const */ VALUE_RE = regexp.MustCompile("([0-9.]+)([a-z#]*)") +const VALUE_TYPE_ANGLE string = "angle" const VALUE_TYPE_LENGTH string = "length" -const VALUE_TYPE_VELOCITY string = "velocity" const VALUE_TYPE_MASS string = "weight" +const VALUE_TYPE_VELOCITY string = "velocity" /** Initialize Package */ diff --git a/src/github.com/runeimp/ballistic/parsing.go b/src/github.com/runeimp/ballistic/parsing.go index 6270ed9..de19570 100644 --- a/src/github.com/runeimp/ballistic/parsing.go +++ b/src/github.com/runeimp/ballistic/parsing.go @@ -23,6 +23,7 @@ import ( // Structs // type InputUnits struct { + Angle string Length string Mass string Metric bool @@ -60,6 +61,21 @@ func ParseValue(value, value_type string) (parsed_data ParsedData) { var norm_value float64 switch value_type { + case VALUE_TYPE_ANGLE: + norm_type = "degrees" + + switch suffix { + case "degrees", "degree", "deg", "d": + norm_value = number * 1.0 + designation = ANGLE_LABEL_DEGREES + // InputData.Metric = false + case "radians", "radian", "rad", "r": + norm_value = number * 1.0 + designation = ANGLE_LABEL_RADIANS + // InputData.Metric = false + } + + InputData.Angle = designation case VALUE_TYPE_LENGTH: norm_type = "meter" @@ -97,6 +113,7 @@ func ParseValue(value, value_type string) (parsed_data ParsedData) { designation = LENGTH_LABEL_MILLIMETER InputData.Metric = true } + InputData.Length = designation case VALUE_TYPE_MASS: norm_type = "kilogram" @@ -131,6 +148,7 @@ func ParseValue(value, value_type string) (parsed_data ParsedData) { designation = MASS_LABEL_METRIC_TONNE InputData.Metric = true } + InputData.Mass = designation case VALUE_TYPE_VELOCITY: norm_type = "meters per second" @@ -156,7 +174,7 @@ func ParseValue(value, value_type string) (parsed_data ParsedData) { designation = VELOCITY_LABEL_MPS InputData.Metric = true } - + InputData.Velocity = designation } diff --git a/src/github.com/runeimp/locale/numbers.go b/src/github.com/runeimp/locale/numbers.go index dc9e21f..8eef1c7 100644 --- a/src/github.com/runeimp/locale/numbers.go +++ b/src/github.com/runeimp/locale/numbers.go @@ -66,224 +66,7 @@ const DELIMITER_VBAR = "|" * @see [Indian Numbering System]: https://en.wikipedia.org/wiki/Indian_numbering_system * @see [SI]: https://en.wikipedia.org/wiki/International_System_of_Units */ -const COUNTRY_CA_NUMBER_FORMAT_STD = "### ### ###(,)###" // Canada -const COUNTRY_DE_NUMBER_FORMAT_STD = "### ###.###(,)###" // Germany -const COUNTRY_DK_NUMBER_FORMAT_STD = "### ### ###(,)###" // Denmark -const COUNTRY_ES_NUMBER_FORMAT_STD = "###.###.###(,)###" // Spain -const COUNTRY_FI_NUMBER_FORMAT_STD = "### ### ###(,)###" // Finland -const COUNTRY_FR_NUMBER_FORMAT_STD = "### ### ###(,)###" // France -const COUNTRY_GB_NUMBER_FORMAT_OLD = "###?###?###(|)###" // Great Britain. Old standard. -const COUNTRY_GB_NUMBER_FORMAT_STD = "###,###,###(.)###" // Great Britain -const COUNTRY_IN_NUMBER_FORMAT_STD = "##,##,###(.)###" // Italy -const COUNTRY_IT_NUMBER_FORMAT_STD = "###.###.###(,)###" // Italy -const COUNTRY_MX_NUMBER_FORMAT_ALT = "###;###,###(.)###" // Mexico Alternate -const COUNTRY_MX_NUMBER_FORMAT_STD = "###'###,###(.)###" // Mexico -const COUNTRY_NO_NUMBER_FORMAT_STD = "###.###.###(,)###" // Norway -const COUNTRY_SE_NUMBER_FORMAT_STD = "###.###.###(,)###" // Sweden -const COUNTRY_TH_NUMBER_FORMAT_STD = "###,###,###(.)###" // Thailand -const COUNTRY_UK_NUMBER_FORMAT_OLD = "###?###?###(|)###" // United Kingdom (Great Britain). Old standard. -const COUNTRY_UK_NUMBER_FORMAT_STD = "###,###,###(.)###" // United Kingdom (Great Britain) -const COUNTRY_US_NUMBER_FORMAT_STD = "###,###,###(.)###" // United States -const COUNTRY_ZA_NUMBER_FORMAT_STD = "### ### ###(,)###" // South Africa - -const LANG_DE_NUMBER_FORMAT = "### ###.###(,)###" // German -const LANG_DK_NUMBER_FORMAT = "### ### ###(,)###" // Danish -const LANG_EN_NUMBER_FORMAT_CA = "### ### ###(,)###" // Canadian English -const LANG_EN_NUMBER_FORMAT_GB = "###,###,###(.)###" // British English -const LANG_EN_NUMBER_FORMAT_UK = "###,###,###(.)###" // British English -const LANG_EN_NUMBER_FORMAT_US = "###,###,###(.)###" // American English -const LANG_EO_NUMBER_FORMAT = "###?###?###(,)###" // Esperanto -const LANG_ES_NUMBER_FORMAT_ES_STD = "###.###.###(,)###" // Spanish -const LANG_ES_NUMBER_FORMAT_MX_ALT = "###;###,###(.)###" // Spanish -const LANG_ES_NUMBER_FORMAT_MX_STD = "###'###,###(.)###" // Spanish -const LANG_FI_NUMBER_FORMAT = "### ### ###(,)###" // Finnish -const LANG_FR_NUMBER_FORMAT = "### ### ###(,)###" // French -const LANG_IO_NUMBER_FORMAT = "###.###.###(,)###" // Ido -const LANG_IT_NUMBER_FORMAT = "###.###.###(,)###" // Italian -const LANG_NO_NUMBER_FORMAT = "###.###.###(,)###" // Norwegian -const LANG_SE_NUMBER_FORMAT = "###.###.###(,)###" // Swedish -const LANG_TH_NUMBER_FORMAT = "###,###,###(.)###" // Thai - -// COUNTRY_{ISO 3166-1 alpha-2 code}_NUMBER_SEPARATRIX -const COUNTRY_AD_NUMBER_SEPARATRIX = DELIMITER_COMMA // Andorra -const COUNTRY_AL_NUMBER_SEPARATRIX = DELIMITER_COMMA // Albania -const COUNTRY_AM_NUMBER_SEPARATRIX = DELIMITER_COMMA // Armenia -const COUNTRY_AO_NUMBER_SEPARATRIX = DELIMITER_COMMA // Angola -const COUNTRY_AR_NUMBER_SEPARATRIX = DELIMITER_COMMA // Argentina -const COUNTRY_AT_NUMBER_SEPARATRIX = DELIMITER_COMMA // Austria -const COUNTRY_AU_NUMBER_SEPARATRIX = DELIMITER_POINT // Australia -const COUNTRY_AZ_NUMBER_SEPARATRIX = DELIMITER_COMMA // Azerbaijan -const COUNTRY_BA_NUMBER_SEPARATRIX = DELIMITER_COMMA // Bosnia and Herzegovina -const COUNTRY_BD_NUMBER_SEPARATRIX = DELIMITER_POINT // Bangladesh -const COUNTRY_BE_NUMBER_SEPARATRIX = DELIMITER_COMMA // Belgium -const COUNTRY_BG_NUMBER_SEPARATRIX = DELIMITER_COMMA // Bulgaria -const COUNTRY_BN_NUMBER_SEPARATRIX = DELIMITER_POINT // Brunei Darussalam / CN: Brunei -const COUNTRY_BO_NUMBER_SEPARATRIX = DELIMITER_COMMA // UN: Plurinational State of Bolivia / CN: Bolivia -const COUNTRY_BOT_NUMBER_SEPARATRIX = DELIMITER_POINT // BOT (British Overseas Territories) / AKA: UKOT (United Kingdom Overseas Territories) / AKA: BWI (British West Indies); includes Akrotiri and Dhekelia, Anguilla, Bermuda, British Antarctic Territory, British Indian Ocean Territory, British Virgin Islands, Cayman Islands, Falkland Islands, Gibraltar, Montserrat, (Pitcairn, Henderson, Ducie and Oeno Islands), (Saint Helena, Ascension and Tristan da Cunha), (South Georgia and the South Sandwich Islands), (Turks and Caicos Islands) -const COUNTRY_BR_NUMBER_SEPARATRIX = DELIMITER_COMMA // Brazil -const COUNTRY_BW_NUMBER_SEPARATRIX = DELIMITER_POINT // Botswana -const COUNTRY_BY_NUMBER_SEPARATRIX = DELIMITER_COMMA // Belarus -const COUNTRY_CA_EN_NUMBER_SEPARATRIX = DELIMITER_POINT // Canada (English) -const COUNTRY_CA_EN_NUMBER_THOUSANDS = DELIMITER_SPACE // Canada (English) -const COUNTRY_CA_FR_NUMBER_SEPARATRIX = DELIMITER_COMMA // Canada (French) -const COUNTRY_CA_FR_NUMBER_THOUSANDS = DELIMITER_SPACE // Canada (French) -const COUNTRY_CH_NUMBER_SEPARATRIX = DELIMITER_POINT // Switzerland. Code taken from name in Latin: Confoederatio Helvetica -const COUNTRY_CL_NUMBER_SEPARATRIX = DELIMITER_COMMA // Chile -const COUNTRY_CM_NUMBER_SEPARATRIX = DELIMITER_COMMA // Cameroon -const COUNTRY_CN_NUMBER_SEPARATRIX = DELIMITER_POINT // China -const COUNTRY_CO_NUMBER_SEPARATRIX = DELIMITER_COMMA // Colombia -const COUNTRY_CR_NUMBER_SEPARATRIX = DELIMITER_COMMA // Costa Rica -const COUNTRY_CU_NUMBER_SEPARATRIX = DELIMITER_COMMA // Cuba -const COUNTRY_CY_NUMBER_SEPARATRIX = DELIMITER_COMMA // Cyprus -const COUNTRY_CZ_NUMBER_SEPARATRIX = DELIMITER_COMMA // Czechia / Formerly: Czech Republic -const COUNTRY_DE_NUMBER_MILLIONS = DELIMITER_SPACE // Germany -const COUNTRY_DE_NUMBER_SEPARATRIX = DELIMITER_COMMA // Germany -const COUNTRY_DE_NUMBER_THOUSANDS = DELIMITER_POINT // Germany -const COUNTRY_DK_NUMBER_SEPARATRIX = DELIMITER_COMMA // Denmark -const COUNTRY_DK_NUMBER_THOUSANDS = DELIMITER_SPACE // Denmark -const COUNTRY_DO_NUMBER_SEPARATRIX = DELIMITER_POINT // Dominican Republic -const COUNTRY_DZ_NUMBER_SEPARATRIX = DELIMITER_COMMA // Algeria -const COUNTRY_EC_NUMBER_SEPARATRIX = DELIMITER_COMMA // Ecuador -const COUNTRY_EE_NUMBER_SEPARATRIX = DELIMITER_COMMA // Estonia -const COUNTRY_EG_NUMBER_SEPARATRIX = DELIMITER_POINT // Egypt -const COUNTRY_ES_NUMBER_SEPARATRIX = DELIMITER_COMMA // Spain -const COUNTRY_ES_NUMBER_THOUSANDS = DELIMITER_POINT // Spain -const COUNTRY_FI_NUMBER_SEPARATRIX = DELIMITER_COMMA // Finland -const COUNTRY_FI_NUMBER_THOUSANDS = DELIMITER_SPACE // Finland -const COUNTRY_FO_NUMBER_SEPARATRIX = DELIMITER_COMMA // Faroe Islands / Faroese / Føroyar / Faeroe Islands / Faroes -const COUNTRY_FR_NUMBER_SEPARATRIX = DELIMITER_COMMA // France -const COUNTRY_FR_NUMBER_THOUSANDS = DELIMITER_SPACE // France -const COUNTRY_GB_NUMBER_SEPARATRIX = DELIMITER_POINT // United Kingdom of Great Britain and Northern Ireland -const COUNTRY_GB_NUMBER_THOUSANDS = DELIMITER_COMMA // United Kingdom of Great Britain and Northern Ireland -const COUNTRY_GE_NUMBER_SEPARATRIX = DELIMITER_COMMA // Georgia -const COUNTRY_GH_NUMBER_SEPARATRIX = DELIMITER_POINT // Ghana -const COUNTRY_GL_NUMBER_SEPARATRIX = DELIMITER_COMMA // Greenland -const COUNTRY_GR_NUMBER_SEPARATRIX = DELIMITER_COMMA // Greece -const COUNTRY_GT_NUMBER_SEPARATRIX = DELIMITER_POINT // Guatemala -const COUNTRY_HK_NUMBER_SEPARATRIX = DELIMITER_POINT // Hong Kong -const COUNTRY_HN_NUMBER_SEPARATRIX = DELIMITER_POINT // Honduras -const COUNTRY_HR_NUMBER_SEPARATRIX = DELIMITER_COMMA // Croatia -const COUNTRY_HU_NUMBER_SEPARATRIX = DELIMITER_COMMA // Hungary -const COUNTRY_ID_NUMBER_SEPARATRIX = DELIMITER_COMMA // Indonesia -const COUNTRY_IE_NUMBER_SEPARATRIX = DELIMITER_POINT // Ireland -const COUNTRY_IL_NUMBER_SEPARATRIX = DELIMITER_POINT // Israel -const COUNTRY_IS_NUMBER_SEPARATRIX = DELIMITER_COMMA // Iceland -const COUNTRY_IT_NUMBER_SEPARATRIX = DELIMITER_COMMA // Italy -const COUNTRY_IT_NUMBER_THOUSANDS = DELIMITER_POINT // Italy -const COUNTRY_JO_NUMBER_SEPARATRIX = DELIMITER_POINT // Jordan -const COUNTRY_JP_NUMBER_SEPARATRIX = DELIMITER_POINT // Japan -const COUNTRY_KE_NUMBER_SEPARATRIX = DELIMITER_POINT // Kenya -const COUNTRY_KG_NUMBER_SEPARATRIX = DELIMITER_COMMA // Kyrgyzstan -const COUNTRY_KH_NUMBER_SEPARATRIX = DELIMITER_POINT // Cambodia -const COUNTRY_KP_NUMBER_SEPARATRIX = DELIMITER_POINT // Democratic People's Republic of Korea / CN: North Korea -const COUNTRY_KR_NUMBER_SEPARATRIX = DELIMITER_POINT // Republic of Korea / CN: South Korea -const COUNTRY_KZ_NUMBER_SEPARATRIX = DELIMITER_COMMA // Kazakhstan -const COUNTRY_LB_NUMBER_SEPARATRIX = DELIMITER_POINT // Lebanon -const COUNTRY_LI_NUMBER_SEPARATRIX = DELIMITER_POINT // Liechtenstein -const COUNTRY_LK_NUMBER_SEPARATRIX = DELIMITER_POINT // Sri Lanka -const COUNTRY_LT_NUMBER_SEPARATRIX = DELIMITER_COMMA // Lithuania -const COUNTRY_LU_NUMBER_SEPARATRIX_ALT = DELIMITER_COMMA // Luxembourg -const COUNTRY_LU_NUMBER_SEPARATRIX_STD = DELIMITER_POINT // Luxembourg -const COUNTRY_LV_NUMBER_SEPARATRIX = DELIMITER_COMMA // Latvia -const COUNTRY_MA_NUMBER_SEPARATRIX = DELIMITER_COMMA // Morocco. Code taken from name in French: Maroc -const COUNTRY_MD_NUMBER_SEPARATRIX = DELIMITER_COMMA // UN: Republic of Moldova / CN: Moldova -const COUNTRY_MK_NUMBER_SEPARATRIX = DELIMITER_COMMA // Republic of Macedonia / UN: The former Yugoslav Republic of Macedonia / CN: Macedonia. Code taken from name in Macedonian: Makedonija -const COUNTRY_MM_NUMBER_SEPARATRIX = DELIMITER_POINT // Myanmar -const COUNTRY_MN_NUMBER_SEPARATRIX = DELIMITER_COMMA // Mongolia -const COUNTRY_MO_CN_NUMBER_SEPARATRIX = DELIMITER_POINT // Macao (Chinese) / Formerly: Macau -const COUNTRY_MO_EN_NUMBER_SEPARATRIX = DELIMITER_POINT // Macao (English) / Formerly: Macau -const COUNTRY_MO_PT_NUMBER_SEPARATRIX = DELIMITER_POINT // Macao (Portuguese) / Formerly: Macau -const COUNTRY_MT_NUMBER_SEPARATRIX = DELIMITER_POINT // Malta -const COUNTRY_MV_NUMBER_SEPARATRIX = DELIMITER_POINT // Maldives -const COUNTRY_MX_NUMBER_MILLION_ALT = DELIMITER_SEMICOLON // Mexico -const COUNTRY_MX_NUMBER_MILLION_STD = DELIMITER_APOSTROPHE // Mexico -const COUNTRY_MX_NUMBER_SEPARATRIX = DELIMITER_POINT // Mexico -const COUNTRY_MX_NUMBER_THOUSAND = DELIMITER_COMMA // Mexico -const COUNTRY_MY_NUMBER_SEPARATRIX = DELIMITER_POINT // Malaysia -const COUNTRY_MZ_NUMBER_SEPARATRIX = DELIMITER_COMMA // Mozambique -const COUNTRY_NA_NUMBER_SEPARATRIX_ALT = DELIMITER_COMMA // Namibia -const COUNTRY_NA_NUMBER_SEPARATRIX_STD = DELIMITER_POINT // Namibia -const COUNTRY_NG_NUMBER_SEPARATRIX = DELIMITER_POINT // Nigeria -const COUNTRY_NI_NUMBER_SEPARATRIX = DELIMITER_POINT // Nicaragua -const COUNTRY_NL_NUMBER_SEPARATRIX = DELIMITER_COMMA // Netherlands -const COUNTRY_NO_NUMBER_SEPARATRIX = DELIMITER_COMMA // Norway -const COUNTRY_NP_NUMBER_SEPARATRIX = DELIMITER_POINT // Nepal -const COUNTRY_NZ_NUMBER_SEPARATRIX = DELIMITER_POINT // New Zealand -const COUNTRY_PA_NUMBER_SEPARATRIX = DELIMITER_POINT // Panama -const COUNTRY_PE_NUMBER_SEPARATRIX = DELIMITER_COMMA // Peru -const COUNTRY_PH_NUMBER_SEPARATRIX = DELIMITER_POINT // Philippines -const COUNTRY_PK_NUMBER_SEPARATRIX = DELIMITER_POINT // Pakistan -const COUNTRY_PL_NUMBER_SEPARATRIX = DELIMITER_COMMA // Poland -const COUNTRY_PR_NUMBER_SEPARATRIX = DELIMITER_POINT // Puerto Rico -const COUNTRY_PS_NUMBER_SEPARATRIX = DELIMITER_POINT // State of Palestine / CN: Palestine -const COUNTRY_PT_NUMBER_SEPARATRIX = DELIMITER_COMMA // Portuguese Republic / CN: Portugal -const COUNTRY_PY_NUMBER_SEPARATRIX = DELIMITER_COMMA // Paraguay -const COUNTRY_RO_NUMBER_SEPARATRIX = DELIMITER_COMMA // Romania -const COUNTRY_RS_NUMBER_SEPARATRIX = DELIMITER_COMMA // Serbia -const COUNTRY_RU_NUMBER_SEPARATRIX = DELIMITER_COMMA // UN: Russian Federation / CN: Russia -const COUNTRY_SE_NUMBER_SEPARATRIX = DELIMITER_COMMA // Sweden -const COUNTRY_SE_NUMBER_THOUSANDS = DELIMITER_POINT // Sweden -const COUNTRY_SG_NUMBER_SEPARATRIX = DELIMITER_POINT // Singapore -const COUNTRY_SI_NUMBER_SEPARATRIX = DELIMITER_COMMA // Slovenia -const COUNTRY_SK_NUMBER_SEPARATRIX = DELIMITER_COMMA // Slovakia -const COUNTRY_SV_NUMBER_SEPARATRIX = DELIMITER_POINT // El Salvador -const COUNTRY_TH_NUMBER_SEPARATRIX = DELIMITER_POINT // Thailand -const COUNTRY_TH_NUMBER_THOUSANDS = DELIMITER_COMMA // Thailand -const COUNTRY_TL_NUMBER_SEPARATRIX = DELIMITER_COMMA // Timor-Leste / Formerly: East Timor -const COUNTRY_TM_NUMBER_SEPARATRIX = DELIMITER_COMMA // Turkmenistan -const COUNTRY_TN_NUMBER_SEPARATRIX = DELIMITER_COMMA // Tunisia -const COUNTRY_TR_NUMBER_SEPARATRIX = DELIMITER_COMMA // Turkey -const COUNTRY_TW_NUMBER_SEPARATRIX = DELIMITER_POINT // ROC (Republic of China) / Taiwan, Province of China / CN: Taiwan -const COUNTRY_TZ_NUMBER_SEPARATRIX = DELIMITER_POINT // Tanzania -const COUNTRY_UA_NUMBER_SEPARATRIX = DELIMITER_COMMA // Ukraine / Formerly: Ukrainian SSR -const COUNTRY_UG_NUMBER_SEPARATRIX = DELIMITER_POINT // Uganda -const COUNTRY_UK_NUMBER_SEPARATRIX = DELIMITER_POINT // United Kingdom -const COUNTRY_UK_NUMBER_SEPARATRIX_OLD = DELIMITER_VBAR // United Kingdom. Old standard. -const COUNTRY_UK_NUMBER_THOUSANDS = DELIMITER_COMMA // United Kingdom -const COUNTRY_US_NUMBER_SEPARATRIX = DELIMITER_POINT // United States -const COUNTRY_US_NUMBER_THOUSANDS = DELIMITER_COMMA // United States -const COUNTRY_UY_NUMBER_SEPARATRIX = DELIMITER_COMMA // Uruguay -const COUNTRY_UZ_NUMBER_SEPARATRIX = DELIMITER_COMMA // Uzbekistan -const COUNTRY_VE_NUMBER_SEPARATRIX = DELIMITER_COMMA // UN: Bolivarian Republic of Venezuela / CN: Venezuela -const COUNTRY_VN_NUMBER_SEPARATRIX = DELIMITER_COMMA // Socialist Republic of Vietnam / UN: Viet Nam / CN: Vietnam / CN<1977: South Vietnam. Code used for Republic of Viet Nam -const COUNTRY_XK_NUMBER_SEPARATRIX = DELIMITER_COMMA // Kosovo (temporary country code) -const COUNTRY_ZA_NUMBER_SEPARATRIX_ALT = DELIMITER_POINT // South Africa -const COUNTRY_ZA_NUMBER_SEPARATRIX_STD = DELIMITER_COMMA // South Africa -const COUNTRY_ZW_NUMBER_SEPARATRIX = DELIMITER_POINT // Zimbabwe -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ -// const COUNTRY_xx_NUMBER_SEPARATRIX = DELIMITER_COMMA // _____ - -const COUNTRY_IN_NUMBER_SEPARATRIX = DELIMITER_POINT // India -const COUNTRY_IN_NUMBER_THOUSAND = DELIMITER_COMMA // India -const COUNTRY_IN_NUMBER_HUNDRED_THOUSAND = DELIMITER_COMMA // Indian lakh -const COUNTRY_IN_NUMBER_MYRIAD_TEN = DELIMITER_COMMA // Indian lakh -const COUNTRY_IN_NUMBER_MYRIAD_THOUSAND = DELIMITER_COMMA // Indian crore - -const LANG_EO_NUMBER_SEPARATRIX = DELIMITER_COMMA // Esperanto -const LANG_IA_NUMBER_SEPARATRIX = DELIMITER_COMMA // Interlingua -const LANG_IO_NUMBER_SEPARATRIX = DELIMITER_COMMA // Ido -const LANG_IO_NUMBER_THOUSANDS = DELIMITER_POINT // Ido - -const STANDARD_ISO_NUMBER_SEPARATRIX_ALT = DELIMITER_COMMA // ISO 31-0 -const STANDARD_ISO_NUMBER_SEPARATRIX_STD = DELIMITER_POINT // ISO 31-0 -const STANDARD_ISO_NUMBER_DELIMITER = DELIMITER_SPACE // ISO 31-0 -const STANDARD_SI_NUMBER_SEPARATRIX_ALT = DELIMITER_COMMA // SI, Système international (d'unités), AKA International System of Units. Adopted by all countries except United States, Liberia, and Burma. -const STANDARD_SI_NUMBER_SEPARATRIX_STD = DELIMITER_POINT -const STANDARD_SI_NUMBER_DELIMITER = DELIMITER_SPACE +