Year of the Dragon: Through May 28th, claim free Expansion Pack (excluding Vecna Unleashed) or a Greater Elixir of Discovery! Speak to Xatheral in the Hall of Heroes. edit

Thank you for your patience while we continue to upgrade DDOwiki to the latest MediaWiki LTS version. If you find any errors on the site, please visit the Discord chat server and let us know.

Game mechanicsNewbie guideIn developmentDDO StoreSocial Media


ChallengesClassesCollectablesCraftingEnhancementsEpic DestiniesFavorFeats

GlossaryItemsMapsMonstersPlacesQuestsRacesReincarnationSkillsSpells


Please create an account or log in to remove ads, build a reputation, and unlock more editing privileges and then visit DDO wiki's IRC Chat/Discord if you need any help!

Template:ConvertValueToPercent

From DDO wiki
Jump to navigation Jump to search

Usage[edit]

{{ConvertValueToPercent | (Value)}}

  • 1 = (Value) should be :
    • String value ( 1% - 100% )
    • Numerical value ( 1 - 100 )

Examples[edit]

  • {{ConvertValueToPercent|1%}} = 1%
  • {{ConvertValueToPercent|5%}} = 5%
  • {{ConvertValueToPercent|5}} = 5%

Categorization[edit]

Category:Meta templates

Coding[edit]

  • If value of first parameter is undefind or empty, return 0%
  • If value of first parameter is defined and is not an integer, return first parameter
  • If value of first parameter is defined and is an integer, return first parameter appended with a % sign
  • To do more specific variable validation ( to determine if string is an integer + % sign ), StringFunctions extension will need to be installed

0%