{"id":21300,"date":"2022-04-11T13:56:08","date_gmt":"2022-04-11T11:56:08","guid":{"rendered":"https:\/\/help.openbee.com\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/tricks\/tip-convert-a-string-to-a-decimal\/"},"modified":"2026-05-13T09:36:48","modified_gmt":"2026-05-13T07:36:48","slug":"tip-convert-a-string-to-a-decimal","status":"publish","type":"page","link":"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/tricks\/tip-convert-a-string-to-a-decimal\/","title":{"rendered":"Tip: Convert a string to a decimal"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>var textValue = \"46,5\";\nvar decimalValue = parseFloat(textValue.replace(',', '.'));<\/code><\/pre>\n\n<p>Use to convert the value of an index to decimal:<\/p>\n\n<pre class=\"wp-block-code\"><code>var htAmount = parseFloat(getTextFromIndexInfo(getFirstIndexFromID(pParameters, \"ID_INDEX\")).replace(',', '.'));<\/code><\/pre>\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use to convert the value of an index to decimal:<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":21272,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"templates\/ob-help-products.php","meta":{"footnotes":""},"class_list":["post-21300","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/comments?post=21300"}],"version-history":[{"count":1,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21300\/revisions"}],"predecessor-version":[{"id":21302,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21300\/revisions\/21302"}],"up":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21272"}],"wp:attachment":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/media?parent=21300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}