2018-10-10 18:03:03 -04:00
---
id: bd7993c9c69feddfaeb7bdef
title: Multiply Two Decimals with JavaScript
challengeType: 1
2019-08-28 16:26:13 +03:00
videoUrl: https://scrimba.com/c/ce2GeHq
forumTopicId: 301173
2018-10-10 18:03:03 -04:00
localeTitle: Умножить два десятичных знака с помощью JavaScript
---
## Description
2019-08-28 16:26:13 +03:00
< section id = 'description' >
В JavaScript вы также можете выполнять вычисления с десятичными числами, как и целые числа. Давайте умножим два десятичных знака вместе, чтобы получить их продукт.
< / section >
2018-10-10 18:03:03 -04:00
## Instructions
2019-08-28 16:26:13 +03:00
< section id = 'instructions' >
Измените < code > 0.0< / code > чтобы продукт равнялся < code > 5.0< / code > .
< / section >
2018-10-10 18:03:03 -04:00
## Tests
< section id = 'tests' >
```yml
tests:
2019-08-28 16:26:13 +03:00
- text: The variable < code > product</ code > should equal < code > 5.0</ code > .
testString: assert(product === 5.0);
- text: You should use the < code > *</ code > operator
testString: assert(/\*/.test(code));
2018-10-10 18:03:03 -04:00
```
< / section >
## Challenge Seed
< section id = 'challengeSeed' >
< div id = 'js-seed' >
```js
var product = 2.0 * 0.0;
```
< / div >
2019-08-28 16:26:13 +03:00
### After Tests
2018-10-10 18:03:03 -04:00
< div id = 'js-teardown' >
```js
2019-08-28 16:26:13 +03:00
(function(y){return 'product = '+y;})(product);
2018-10-10 18:03:03 -04:00
```
< / div >
< / section >
## Solution
< section id = 'solution' >
```js
2019-08-28 16:26:13 +03:00
var product = 2.0 * 2.5;
2018-10-10 18:03:03 -04:00
```
2019-08-28 16:26:13 +03:00
2018-10-10 18:03:03 -04:00
< / section >