Verse integer parsing/interpretation error

Summary

Running the following verse code:

        six : int = 06
        seven :int = 07
        eight :int = 08
        nine :int = 09
        ten :int = 10

        Print("six: {six}")
        Print("seven: {seven}")
        Print("eight: {eight}")
        Print("nine: {nine}")        
        Print("ten: {ten}")

produces the following output:

LogVerse: : six: 6
LogVerse: : seven: 7
LogVerse: : eight: 0
LogVerse: : nine: 0
LogVerse: : ten: 10

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

Run the code above

Expected Result

integers 8 and 9 are properly represented

Observed Result

8 and 9 are represented as zeros

Platform(s)

PC

Hello Tshock22_! I’ll try to help you with this issue!

As I can understand, int variables are not designed to support 0 at its left and that could be causing this issue. To avoid it, you can use the numbers with only one digit if they are below 10 or, if you need to specifically print two digits, cast the int to strings (you can find how to do it here), concatenate the leading zero and print the result.

Please let me know if that helps!

1 Like