Skip to content

Using Number.toString() #2218

Discussion options

You must be logged in to vote

Hello @shark-in-a-hat ,

The error message is misleading so I keep the issue open, but you can use .toString() if you create the number with the Brython equivalent of Javascript's new Number(128):

Brython 3.11.2 on Netscape 5.0 (Windows)
Type "help", "copyright", "credits" or "license" for more information.
>>> from javascript import Number as js_num
>>> x = js_num.new(128)
>>> x
<Javascript object: [object Number]>
>>> x.toString(32)
'40'
>>> 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@shark-in-a-hat
Comment options

Comment options

You must be logged in to vote
1 reply
@shark-in-a-hat
Comment options

Answer selected by shark-in-a-hat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants