I am parsing an excel spreadsheet with a cell that is custom formatted. The value is actually 25 but the format to display it is 'JPY25'. Creek gets the number but the number is converted to a DateTime after passing through the convert function.
This is the node.attributes hash:
{"r"=>"M2", "s"=>"8"}
When the convert function(Ref below) is called from inside the rows_generator function, node.value is 25 for a cell formatted as 'JPY25' but because of the node.attributes['s'], the type(which is nil - determined by node.attributes['t']) is determined by style(which is DateTime) and a DateTime value is generated after Creek::Styles::Converter.call is called.
Can we have the ability to pass an optional hash in instance method simple_rows of Creek::Sheet class?
This way, we can define what type (:float, :string, :date, :bignum etc) we want for a particular column. Maybe a hash like below:
type_hash = {"A" => :float, "B" => :string}
Please let me know if this approach is correct or if there is a more valid solution.
P.S. Please don't mind the explanation part. Doing it for the first time.
I am parsing an excel spreadsheet with a cell that is custom formatted. The value is actually 25 but the format to display it is 'JPY25'. Creek gets the number but the number is converted to a DateTime after passing through the convert function.
This is the node.attributes hash: {"r"=>"M2", "s"=>"8"}
When the convert function(Ref below) is called from inside the rows_generator function, node.value is 25 for a cell formatted as 'JPY25' but because of the node.attributes['s'], the type(which is nil - determined by node.attributes['t']) is determined by style(which is DateTime) and a DateTime value is generated after Creek::Styles::Converter.call is called.
Can we have the ability to pass an optional hash in instance method simple_rows of Creek::Sheet class? This way, we can define what type (:float, :string, :date, :bignum etc) we want for a particular column. Maybe a hash like below:
type_hash = {"A" => :float, "B" => :string}
Please let me know if this approach is correct or if there is a more valid solution.
P.S. Please don't mind the explanation part. Doing it for the first time.