The suitable data type for this is a decimal with precision of 9 and scale of 6 [decimal(9,6)]. The activerecord migration code for this turned out to be thus:
add_column :livetokens, :latitude, :decimal, :precision => 9, :scale => 6
C#, .Net, MVC, jQuery, JavaScript, HTML, CSS, Umbraco, Phonegap / Cordova, Xamarin, iPhone, iOS, Swift, Android, Windows, apps, websites, Full Stack, ecommerce, Facebook, responsive, front-end. Freelance developer, programmer for web and mobile in Bristol, UK.
add_column :livetokens, :latitude, :decimal, :precision => 9, :scale => 6
No comments:
Post a Comment
Comments are moderated, so you'll have to wait a little bit before they appear!