Skip to content

Build UI component that understands SI suffixes and validates/returns an integer for bandwidths and other large numbers #210

@sartaj10

Description

@sartaj10

Adding some context to this

Some users prefer to enter 10.5g  for a numeric field instead of having to count out zeros and enter 10500000000. The bandwidth property for throughput is the poster child for this. pScheduler supports this on the command line for selected fields, but the JSON it gets converted to is still numeric. There's some jq that does the conversion; the table of suffixes at the top might be useful:  https://github.com/perfsonar/pscheduler/blob/master/pscheduler-jq-library/pscheduler-jq-library/si.jq

Examples (suffixes are case-insensitive):

10ki becomes 10240
3.14M becomes 3140000
1234 becomes 1234 (no prefix, no change)
0y becomes 0 
8GI becomes 8589934592

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions