Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

SetFormat - Money


  • Please log in to reply
1 reply to this topic
Albireo
  • Members
  • 558 posts
  • Last active: Dec 13 2019 02:02 PM
  • Joined: 01 Feb 2006
Hello!
I have made a program who count sum on prices on some products.
Something like ..:

1250,95 + 798,53 + 34,50 + 768,57 = 2118,51


I want to present "2118,51" as "2 119 kr" or "2.119 kr"
I round the value I used
SetFormat float, 0.2
The result was .: "2119" its OK! but..

How to get space between thousand and hundred?
( 2 119 kr or 12 213 kr and so on)

//Jan

rbrtryn
  • Members
  • 1177 posts
  • Last active: Sep 11 2013 08:04 PM
  • Joined: 22 Jun 2011
You could use this (Thanks to infogulch). Original post here.
Var := 12213
Result := RegExReplace(Var, "\G\d+?(?=(?:\d{3})+(?:\D|$))", "$0 ")
MsgBox %Result%

My Scripts are written for the latest released version of AutoHotkey.

Need a secure, accessible place to backup your stuff? Use Dropbox!