Displaying 2 results from an estimated 2 matches for "number_of_digits".
2008 Jun 13
7
Rubyscript2exe undefined ''run'' method
...]
RUBYSCRIPT2EXE.bin = ["random_frame.rb"]
def random_process
file = @file_path.split("\\")
@file_path = file.join("\\\\")
@file_path << "\\Random.txt"
random_file = File.new(@file_path , "w")
i = 0
max = @max_number.to_i
b = 10 ** (@number_of_digits.to_i - 1)
random_seed = 10 ** (@number_of_digits.to_i)
g = 0
g_max =100
@progress_guage.set_value(0)
while i < max
a = rand(random_seed)
if (a > b) then
random_file.puts a
i = i + 1
while ((i/max) * 100) > (@progress_guage.get_value())
@progress_guage.pulse()...
2010 Feb 10
6
validation problems
Hi, there.
I have two validations in the model:
validates_numericality_of :value, :only_integer=>true,
:allow_blank=>true
validates_size_of :value, :is=>9, :message=>"must be 5-digit number",
:if=>Proc.new{|u| u.value.is_a?(Numeric)}
They work as expected except when the :value is character/string like
"a" "abc", the second validation will also output