62 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| id: cf1391c1c11feddfaeb4bdef
 | |
| title: Create Decimal Numbers with JavaScript
 | |
| challengeType: 1
 | |
| videoUrl: ''
 | |
| localeTitle: Crea números decimales con JavaScript
 | |
| ---
 | |
| 
 | |
| ## Description
 | |
| <section id="description"> Podemos almacenar números decimales en variables también. Los números decimales a veces se denominan números de <dfn>punto flotante</dfn> o <dfn>flotantes</dfn> . <strong>Nota</strong> <br> No todos los números reales se pueden representar con precisión en <dfn>coma flotante</dfn> . Esto puede llevar a errores de redondeo. <a href="https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems" target="_blank">Detalles aquí</a> . </section>
 | |
| 
 | |
| ## Instructions
 | |
| <section id="instructions"> Cree una variable <code>myDecimal</code> y <code>myDecimal</code> un valor decimal con una parte fraccionaria (por ejemplo, <code>5.7</code> ). </section>
 | |
| 
 | |
| ## Tests
 | |
| <section id='tests'>
 | |
| 
 | |
| ```yml
 | |
| tests:
 | |
|   - text: <code>myDecimal</code> debe ser un número.
 | |
|     testString: 'assert(typeof myDecimal === "number", "<code>myDecimal</code> should be a number.");'
 | |
|   - text: <code>myDecimal</code> debería tener un punto decimal
 | |
|     testString: 'assert(myDecimal % 1 != 0, "<code>myDecimal</code> should have a decimal point"); '
 | |
| 
 | |
| ```
 | |
| 
 | |
| </section>
 | |
| 
 | |
| ## Challenge Seed
 | |
| <section id='challengeSeed'>
 | |
| 
 | |
| <div id='js-seed'>
 | |
| 
 | |
| ```js
 | |
| var ourDecimal = 5.7;
 | |
| 
 | |
| // Only change code below this line
 | |
| 
 | |
| ```
 | |
| 
 | |
| </div>
 | |
| 
 | |
| 
 | |
| ### After Test
 | |
| <div id='js-teardown'>
 | |
| 
 | |
| ```js
 | |
| console.info('after the test');
 | |
| ```
 | |
| 
 | |
| </div>
 | |
| 
 | |
| </section>
 | |
| 
 | |
| ## Solution
 | |
| <section id='solution'>
 | |
| 
 | |
| ```js
 | |
| // solution required
 | |
| ```
 | |
| </section>
 |