{"provider_url":"https://hatena.blog","author_name":"griefworker","width":"100%","url":"https://tnakamura.hatenablog.com/entry/20090714/python_string_decimal_cast","author_url":"https://blog.hatena.ne.jp/griefworker/","height":"190","description":"Python \u3067\u3001\u6587\u5b57\u5217\u3092\u6570\u5024(decimal)\u306b\u5909\u63db\u53ef\u80fd\u304b\u3069\u3046\u304b\u3092\u8abf\u3079\u308b\u306b\u306f\u3001\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3093\u3060\u308d\u3046\uff1fC# \u306a\u3089 TryParse \u30e1\u30bd\u30c3\u30c9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u66f8\u3051\u308b\u3002 decimal value; if (decimal.TryParse(decimalString, out value) == false) { // decimal \u306b\u5909\u63db\u3067\u304d\u306a\u3044\u3068\u304d\u306e\u51e6\u7406 } Python \u306e\u6587\u5b57\u5217\u306b\u306f isdigit() \u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308b\u3051\u3069\u3001\u6587\u5b57\u5217\u304c\u5168\u3066\u6570\u5b57\u306e\u3068\u304d\u3057\u304b True \u306b\u306a\u3089\u306a\u3044\u3002\u5c0f\u6570\u306e\u6587\u5b57\u5217\u306f False \u3068\u5224\u65ad\u3055\u308c\u3066\u3057\u307e\u3046\u3002 \"12345\".isdigit() #=> Tr\u2026","type":"rich","blog_title":"present","image_url":null,"version":"1.0","published":"2009-07-14 00:00:00","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftnakamura.hatenablog.com%2Fentry%2F20090714%2Fpython_string_decimal_cast\" title=\"Python \u306b C# \u306e TryParse \u306b\u76f8\u5f53\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u304c\u898b\u5f53\u305f\u3089\u306a\u3044 - present\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"Python \u306b C# \u306e TryParse \u306b\u76f8\u5f53\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u304c\u898b\u5f53\u305f\u3089\u306a\u3044","provider_name":"Hatena Blog","blog_url":"https://tnakamura.hatenablog.com/","categories":["Python"]}