{"id":78,"date":"2022-12-06T08:58:56","date_gmt":"2022-12-06T08:58:56","guid":{"rendered":"https:\/\/www.devopsconsulting.in\/blog\/?p=78"},"modified":"2022-12-06T08:58:58","modified_gmt":"2022-12-06T08:58:58","slug":"dart-flutter-how-to-convert-one-datatype-to-other-data","status":"publish","type":"post","link":"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/","title":{"rendered":"Dart\/Flutter \u2013 How to convert one dataType to other Data"},"content":{"rendered":"\n<p><strong>Int to dubble<\/strong><\/p>\n\n\n\n<p>To convert a int to double in Dart, we can use one of the built-in methods depending on your need:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void main() {\r\n  int i = 5;\r\n  print(i.toDouble());          \/\/ 5.0\r\n}\r\n<\/code><\/pre>\n\n\n\n<p><strong>toInt( ) or truncate( ):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void main() {\r\n  dubble i = 5.0;\r\n  print(i.toInt());           \/\/ 5\r\n \r\n}<\/code><\/pre>\n\n\n\n<p><strong>round( ):<\/strong><\/p>\n\n\n\n<p>return the closest\/nearest integer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void main() {\r\nint i = 4.7;\r\nprint(i.round()); \/\/ 5.0\r\n}<\/code><\/pre>\n\n\n\n<p><strong>ceil( ): <\/strong><\/p>\n\n\n\n<p>return the least integer that is not smaller than this number.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void main() {\r\n  int i = 5.3;\r\n  print(i.ceil());          \/\/ 5.0\r\n}<\/code><\/pre>\n\n\n\n<p><strong>floor( ):<\/strong><\/p>\n\n\n\n<p> return the greatest integer not greater than this number<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void main() {\r\n  int i = 5.3;\r\n   print(i.floor());          \/\/ 5\r\n \r\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Int to dubble To convert a int to double in Dart, we can use one of the built-in methods depending on your need: toInt( ) or truncate(&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Dart\/Flutter \u2013 How to convert one dataType to other Data - DevOps Consulting<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dart\/Flutter \u2013 How to convert one dataType to other Data - DevOps Consulting\" \/>\n<meta property=\"og:description\" content=\"Int to dubble To convert a int to double in Dart, we can use one of the built-in methods depending on your need: toInt( ) or truncate(...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-06T08:58:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-06T08:58:58+00:00\" \/>\n<meta name=\"author\" content=\"Abhishek Singh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abhishek Singh\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/dart-flutter-how-to-convert-one-datatype-to-other-data\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/dart-flutter-how-to-convert-one-datatype-to-other-data\\\/\"},\"author\":{\"name\":\"Abhishek Singh\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#\\\/schema\\\/person\\\/fc397ba8be42f9fdd53450edfc73006f\"},\"headline\":\"Dart\\\/Flutter \u2013 How to convert one dataType to other Data\",\"datePublished\":\"2022-12-06T08:58:56+00:00\",\"dateModified\":\"2022-12-06T08:58:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/dart-flutter-how-to-convert-one-datatype-to-other-data\\\/\"},\"wordCount\":64,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/dart-flutter-how-to-convert-one-datatype-to-other-data\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/dart-flutter-how-to-convert-one-datatype-to-other-data\\\/\",\"url\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/dart-flutter-how-to-convert-one-datatype-to-other-data\\\/\",\"name\":\"Dart\\\/Flutter \u2013 How to convert one dataType to other Data - DevOps Consulting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#website\"},\"datePublished\":\"2022-12-06T08:58:56+00:00\",\"dateModified\":\"2022-12-06T08:58:58+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#\\\/schema\\\/person\\\/fc397ba8be42f9fdd53450edfc73006f\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/dart-flutter-how-to-convert-one-datatype-to-other-data\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/\",\"name\":\"DevOps Consulting\",\"description\":\"DevOps Consulting | SRE Consulting | DevSecOps Consulting | MLOps Consulting\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/#\\\/schema\\\/person\\\/fc397ba8be42f9fdd53450edfc73006f\",\"name\":\"Abhishek Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g\",\"caption\":\"Abhishek Singh\"},\"description\":\"I\u2019m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I\u2019ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains: \u2022 DevOps School \u2013 Tech blogs and tutorials \u2022 Holiday Landmark \u2013 Travel stories and guides \u2022 Stocks Mantra \u2013 Stock market strategies and tips \u2022 My Medic Plus \u2013 Health and fitness guidance \u2022 TrueReviewNow \u2013 Honest product reviews \u2022 Wizbrand \u2013 SEO and digital tools for businesses I\u2019m also exploring the fascinating world of Quantum Computing.\",\"url\":\"https:\\\/\\\/www.devopsconsulting.in\\\/blog\\\/author\\\/abhishek\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dart\/Flutter \u2013 How to convert one dataType to other Data - DevOps Consulting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/","og_locale":"en_US","og_type":"article","og_title":"Dart\/Flutter \u2013 How to convert one dataType to other Data - DevOps Consulting","og_description":"Int to dubble To convert a int to double in Dart, we can use one of the built-in methods depending on your need: toInt( ) or truncate(...","og_url":"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/","og_site_name":"DevOps Consulting","article_published_time":"2022-12-06T08:58:56+00:00","article_modified_time":"2022-12-06T08:58:58+00:00","author":"Abhishek Singh","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abhishek Singh"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/#article","isPartOf":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/"},"author":{"name":"Abhishek Singh","@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f"},"headline":"Dart\/Flutter \u2013 How to convert one dataType to other Data","datePublished":"2022-12-06T08:58:56+00:00","dateModified":"2022-12-06T08:58:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/"},"wordCount":64,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/","url":"https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/","name":"Dart\/Flutter \u2013 How to convert one dataType to other Data - DevOps Consulting","isPartOf":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/#website"},"datePublished":"2022-12-06T08:58:56+00:00","dateModified":"2022-12-06T08:58:58+00:00","author":{"@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopsconsulting.in\/blog\/dart-flutter-how-to-convert-one-datatype-to-other-data\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.devopsconsulting.in\/blog\/#website","url":"https:\/\/www.devopsconsulting.in\/blog\/","name":"DevOps Consulting","description":"DevOps Consulting | SRE Consulting | DevSecOps Consulting | MLOps Consulting","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopsconsulting.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopsconsulting.in\/blog\/#\/schema\/person\/fc397ba8be42f9fdd53450edfc73006f","name":"Abhishek Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/790feefe779852cdf344ca7318bf6c13832223c9b3c6bf4d217658412041026d?s=96&d=mm&r=g","caption":"Abhishek Singh"},"description":"I\u2019m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I\u2019ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains: \u2022 DevOps School \u2013 Tech blogs and tutorials \u2022 Holiday Landmark \u2013 Travel stories and guides \u2022 Stocks Mantra \u2013 Stock market strategies and tips \u2022 My Medic Plus \u2013 Health and fitness guidance \u2022 TrueReviewNow \u2013 Honest product reviews \u2022 Wizbrand \u2013 SEO and digital tools for businesses I\u2019m also exploring the fascinating world of Quantum Computing.","url":"https:\/\/www.devopsconsulting.in\/blog\/author\/abhishek\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":80,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions\/80"}],"wp:attachment":[{"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsconsulting.in\/blog\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}