Parameter valueAsNumber not returning correct number.
See original GitHub issueNote: for support questions, please first reference our documentation, then use Stackoverflow. This repository’s issues are intended for feature requests and bug reports.
-
I’m submitting a …
- [X ] 🪲 bug report
- 🚀 feature request
- 📚 construct library gap
- ☎️ security issue or vulnerability => Please see policy
- ❓ support request => Please see note at the top of this template.
-
What is the current behavior? If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce
Create a CfnParameter
with type
'Number'
and a default value
.
Use that value
somewhere with parameter.valueAsNumber
Produces a value of -1.8881545897087546e+289
cosnt param = new CfnParameter(this, 'RedendtionPeriod', {
description: 'SQS redention period in seconds 60 - 1209600 [14400]',
type: 'Number',
default: 14400,
minValue: 60,
maxValue: 1209600,
constraintDescription: 'Must be between 60 and 1209600',
});
param.valueAsNumber // -1.8881545897087546e+289
-
What is the expected behavior (or behavior of feature suggested)? Return the token for that value.
-
Please tell us about your environment:
- CDK CLI Version: 1.2.0
- Module Version: 1.2.0
- OS: OSX Mojave
- Language: Typescript
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
type of event.target.value should be changed to integer in react
Actually there is a more direct way. You can simply get the value as a number without transforming it : event.target.valueAsNumber.
Read more >NUMBERVALUE function - Microsoft Support
Description. Converts text to a number, in a locale-independent way. ... If any of the arguments are not valid, NUMBERVALUE returns the #VALUE!...
Read more >Why the number input is the worst input - Stack Overflow Blog
valueAsNumber ` to access a numeric value. (It returns `NaN` for illegal values.) It also avoids the coercion foot-gun which means this is...
Read more >769370 - implement valueAsNumber and valueAsDate for ...
This bug will need to deal with the conversions between string/date and string/number as described here http://www.whatwg.org/specs/web-apps/current-work/ ...
Read more >4.10.7.2 Common input element attributes — HTML5 - W3C
On getting, if the valueAsNumber attribute does not apply, as defined for the input element's type attribute's current state, then return a Not-a-Number...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nagupta92 Ive reopened.
Ill open a better bug report