<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mi---tomo</author_name>
  <author_url>https://blog.hatena.ne.jp/mi---tomo/</author_url>
  <blog_title>mi---tomo’s diary</blog_title>
  <blog_url>https://miiitomo.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>自分用メモ railsの計算でNaNやInfinityを回避する 一旦変数として入れるとうまくいく、一発で処理させようとするとエラー 下の内容は正規表現で数字かどうか判断している profit_ratio = ((1 - (@total_costs.to_f / @total_price.to_f ) )* 100).round(2) if profit_ratio.to_s =~ /^[+-]?[0-9]*[\.]?[0-9]+$/ else profit_ratio = &quot;&quot; end htmlでは &lt;% kakeritu = ((price_detail.unit_price.to_f /…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmiiitomo.hatenablog.com%2Fentry%2F2024%2F06%2F27%2F102627&quot; title=&quot;自分用メモ  railsの計算でNaNやInfinityを回避する - mi---tomo’s diary&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>2024-06-27 10:26:27</published>
  <title>自分用メモ  railsの計算でNaNやInfinityを回避する</title>
  <type>rich</type>
  <url>https://miiitomo.hatenablog.com/entry/2024/06/27/102627</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
