# Assessment wanted for 'silly story generator'

**URL:** <https://discourse.mozilla.org/t/assessment-wanted-for-silly-story-generator/65062>\
**Category:** Learn\
**Created:** [August 3, 2020, 2:25pm UTC](https://discourse.mozilla.org/t/assessment-wanted-for-silly-story-generator/65062 "2020-08-03T14:25:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur\_Chen](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@Arthur\_Chen](https://discourse.mozilla.org/u/Arthur_Chen)\
**Post date:** [August 3, 2020, 2:25pm UTC](https://discourse.mozilla.org/t/assessment-wanted-for-silly-story-generator/65062/1 "2020-08-03T14:25:58Z")

</div>

I have completed the silly story generator assessment. Please assess my code and let me know on how I could improve if I have any mistakes. Here is the link to my assessment: [https://glitch.com/~scarlet-island-burrito](https://glitch.com/~scarlet-island-burrito)

---

<div class="post-metadata">

**Author:** ![chrisdavidmills](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/chrisdavidmills/32/21688_2.png) [@chrisdavidmills](https://discourse.mozilla.org/u/chrisdavidmills)\
**Post date:** [August 4, 2020, 6:46am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-silly-story-generator/65062/2 "2020-08-04T06:46:52Z")

</div>

Hi @Arthur_Chen!

This is working pretty much perfectly, except for one part — the `if(document.getElementById("uk").checked) { ... }` block.

When the UK radio button is selected, the temperature and weight are outputted into the story as `NaN` (not a number). This is because in each case you are trying to run the `Math.round()` function on the whole string, not just the number part of the string. For example:

```auto
let weight = Math.round(300 / 14 + ' stone');

```

If you changed this to

```auto
let weight = Math.round(300 / 14) + ' stone';

```

Then it would work fine.

Also, you’ve got the two variables the wrong way round in these lines:

```auto
newStory = newStory.replace('94 fahrenheit', weight);
 newStory = newStory.replace('300 pounds', temperature);

```

But apart from that, it is working well. Great work here, well done!
