Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid octal digit error [duplicate]

Tags:

ruby

api

octal

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.

like image 340
Paz Aricha Avatar asked Dec 26 '22 22:12

Paz Aricha


1 Answers

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.

like image 97
Wouter Avatar answered Jan 15 '23 10:01

Wouter