• 0
Cripplez

solved [Help] How can i use "text" in Bonus Page?

Question

Hi, i'd like to add the symbol " % " in my Bonus Page.

For example i have this line and in game i see the result of bonus 45*2, how can i add the symbol % at the end of the result?

Thank you

self.GetChild2("Text_Slot29").SetText(str((player.GetStatus(45)*2)))

 

Share this post


Link to post
Share on other sites

2 answers to this question

  • 1

You should use a string format method, instead of convert an integer to string then concatenate two strings for no reason.

  • New format
self.GetChild2("Text_Slot29").SetText('{}%'.format(player.GetStatus(45) * 2))
  • Old format
self.GetChild2("Text_Slot29").SetText('%d%%' % (player.GetStatus(45) * 2))

 

  • Thanks 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.