Topic on User talk:Harakoni

Jump to navigation Jump to search
Summary by Harakoni

Market Value template not rounding properly. Updated code to fix.

Dakon (talkcontribs)

I don't know if you are the right person to contact but I noticed an issue with the rounding of the market values in the info box on the top right of pages about weapons. The market values are rounded to the nearest ten, which is incorrect.

Example: I recently corrected the market value of the EMP launcher to 505 but it is rounded up to 510 in the info box.

As described on the page about market value, "items with a market value of above 200 will have their market value rounded to be divisible by 5, with a remainder of 2.5 being rounded down."

The market values on the page https://rimworldwiki.com/wiki/Weapons are rounded correctly, which creates an inconsistency.

It would be great if you could let someone know that has the permissions to fix this.

Harakoni (talkcontribs)

Yup, I'm the right person, or one of them at least. There definitely is an issue in the rounding calcs somewhere. I'll take a look and see if I can get it sorted.

But also always feel free to investigate and experiment if you want to. The issue is very likely in Template: infobox main or Template: Market Value both of which you should have permission to edit (also templates used on a page are listed at the bottom when you edit). If you're editing a template, just check a few pages its used on and make sure that you didn't break anything. If you did, then revert. No harm, no foul.

Harakoni (talkcontribs)

Alright, it appears to be working as intended now. There was an issue with the implementation of the Template:Market Value. I've done some rough testing and it seems to now match the method listed on Market Value. If you find any more problems with the template, or anywhere you think its being used to round values, let me know.

Dakon (talkcontribs)

Seems to work perfectly now. Thanks.