# How to get the data type of a variable?

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-data-type-of-a-variable/138706>\
**Category:** Rails\
**Created:** [May 27, 2008, 1:52am UTC](https://www.ruby-forum.com/t/how-to-get-the-data-type-of-a-variable/138706 "2008-05-27T01:52:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wings](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e495f1/32.png) [@wings](https://www.ruby-forum.com/u/wings)\
**Post date:** [May 27, 2008, 1:52am UTC](https://www.ruby-forum.com/t/how-to-get-the-data-type-of-a-variable/138706/1 "2008-05-27T01:52:57Z")

</div>

Hi all:

I’m importing a csv file which I need to check if a particular column is  
a valid dollar amount (doest need to have the $ sign)

What I have is  
if parsed[column5].class.to\_s = Float

But this class method is actually giving me “CSV::Cell”

Would anyone be able to give me a hand on this?

Thanks

grace
