Created
April 9, 2019 14:00
-
-
Save femioladeji/b5e23dbaca015d9235ffa81c6db975c3 to your computer and use it in GitHub Desktop.
aws lambda function tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const roundNumber = (number, decimlPlaces) => { | |
return Number((Math.round(number + `e${decimlPlaces}`)) + `e-${decimlPlaces}`); | |
} | |
exports.handler = async (event) => { | |
const number = 4.356; | |
const decimalPlaces = 2; | |
const answer = roundNumber(number, decimalPlaces); | |
const response = { | |
statusCode: 200, | |
body: answer, | |
}; | |
return response; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment