无效的八进制数字错误 [英] Invalid octal digit error
问题描述
在Ruby中无效的八进制数字的错误,我怎么擦肩而过呢?我有一个数字, 0962833
,我需要发送一个API,但因为我得到这个无效的八进制数字的错误,我不能把它。
Invalid octal digit error in Ruby, how do I by pass that? I have a number, 0962833
, which I need to send to an API but I can't send it since I get this invalid octal digit error.
我需要一个工作围绕头也不回这个数字转换成字符串,零不能被删除,这是必须的。
I need a work around for that without turning that number into a string, the zero can't be removed, it's a must.
推荐答案
八进制数使用数字0到7也许错误可能是你的电话号码数字9和第8位。
如果你想通过数字962833,尝试用一个网上转换器首先将其转换为正确的八进制数。然后加入领先的0,并把它传递给你的函数。
Octal numbers use the digits 0 to 7. Maybe the error could be the digit 9, and digit 8 in your number. If you want to pass the number '962833', try converting it first to a correct octal number with an online converter. Then add the leading '0' and pass it to your function.
这篇关于无效的八进制数字错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!