<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>perlcodesample</author_name>
  <author_url>https://blog.hatena.ne.jp/perlcodesample/</author_url>
  <blog_title>Perl入門ゼミ</blog_title>
  <blog_url>https://perlcodesample.hatenadiary.jp/</blog_url>
  <categories>
  </categories>
  <description>Perl › 関数 › here sprintf関数を使用すると書式指定した文字列を作成することができます。数値の左側を0で埋めて出力したい場合や、浮動小数点の少数の桁数を指定したい場合などに、sprintf関数を使うと便利です。 my $str = sprintf(&quot;%08d&quot;, $num1); my $str = sprintf(&quot;%.2f&quot;, $num2); my $str = sprintf(&quot;aiueo%08daiueo%.2f&quot;, $num1, $num2); 数値や文字列をある規則にしたがって出力したい場合があります。たとえば、足りない部分を空白で埋めた固定長の文字列を作成したい…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fperlcodesample.hatenadiary.jp%2Fentry%2F20081001%2F1222963156&quot; title=&quot;sprintf関数 - 文字列の書式指定 - Perl入門ゼミ&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>2008-10-01 00:59:16</published>
  <title>sprintf関数 - 文字列の書式指定</title>
  <type>rich</type>
  <url>https://perlcodesample.hatenadiary.jp/entry/20081001/1222963156</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
