Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Decimal Precision for certain sensors on CPX and CLUE #346

Merged
merged 5 commits into from
Apr 20, 2020

Conversation

xnkevinnguyen
Copy link
Contributor

@xnkevinnguyen xnkevinnguyen commented Apr 20, 2020

Description:

We have added precision for certains sensors:
CPX:
-acceleration
-temperature
CLUE:
-temperature
-acceleration
-humidity
-pressure
-gyro
-magnetic

Range has been modified for cpx light sensor and clue light sensor.
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Limitations:

Please describe limitations of this PR

Testing:

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • My code has been formatted with npm run format and passes the checks in npm run check
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@xnkevinnguyen xnkevinnguyen changed the title WIP: Decimal Precision for certain sensors Decimal Precision for certain sensors on CPX and CLUE Apr 20, 2020
@@ -31,8 +34,9 @@ class InputSlider extends React.Component<ISliderProps, any, any> {
onInput={this.handleOnChange}
defaultValue={this.props.minValue.toLocaleString()}
pattern={`^-?[0-9]{0,${
this.props.maxValue.toString().length
}}$`}
(this.props.maxValue / this.props.step).toString()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this pattern for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to control the input of the user for sensor value. to limit the number of digit after the period also to limit the max value by limiting length of input.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants