<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mtoyoshi</author_name>
  <author_url>https://blog.hatena.ne.jp/mtoyoshi/</author_url>
  <blog_title>mtoyoshi開発メモ</blog_title>
  <blog_url>https://mtoyoshi.hateblo.jp/</blog_url>
  <categories>
    <anon>Javascript</anon>
  </categories>
  <description>文字型の数字を数字型へ（正確には整数に）変換するにはparseInt関数を使う。 parseInt(&quot;2.2&quot;); parseInt(2.2); 文字型のものだけでなく、数字型のものを渡してもいずれも「2」が返ってきます。うん、便利。 しかしながら、以下のケースでは嬉しくない結果が返ります。 parseInt(&quot;2abc&quot;); これは当然「NaN」になるのかと思っていたのですが、「2」が返ってきます！ビツクリ！！ というわけで思いついたのはこんなの。 parseInt(1 * &quot;2abc&quot;); 1をかけることで、強制的に文字型から数字型へ変換しています。この時点で「NaN」になります。 追記 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmtoyoshi.hateblo.jp%2Fentry%2F20090313%2F1236943249&quot; title=&quot;文字から数字（整数）へ - mtoyoshi開発メモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-03-13 20:20:49</published>
  <title>文字から数字（整数）へ</title>
  <type>rich</type>
  <url>https://mtoyoshi.hateblo.jp/entry/20090313/1236943249</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
