Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 15:47

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Tausender Separator

Discussion on Tausender Separator within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2010
Posts: 92
Received Thanks: 11
Tausender Separator

Hallo zusammen,

kann mir einer sagen wie man in AI Zahlen mit Tausenderseparator darstellen kann?

THX
BotofWar is offline  
Old 03/29/2010, 08:31   #2
 
elite*gold: 0
Join Date: May 2008
Posts: 5
Received Thanks: 1
Code:
; #FUNCTION# ====================================================================================================================
; Name...........: _StringAddThousandsSep
; Description ...: Returns the original numbered string with the Thousands delimiter inserted.
; Syntax.........: _StringAddThousandsSep($sString[, $sThousands = -1[, $sDecimal = -1]])
; Parameters ....: $sString    - The string to be converted.
;                  $sThousands - Optional: The Thousands delimiter
;                  $sDecimal   - Optional: The decimal delimiter
; Return values .: Success - The string with Thousands delimiter added.
; Author ........: SmOke_N (orignal _StringAddComma
; Modified.......: Valik (complete re-write, new function name)
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================
Func _StringAddThousandsSep($sString, $sThousands = -1, $sDecimal = -1)
	Local $sResult = "" ; Force string
	Local $rKey = "HKCU\Control Panel\International"
	If $sDecimal = -1 Then $sDecimal = RegRead($rKey, "sDecimal")
	If $sThousands = -1 Then $sThousands = RegRead($rKey, "sThousand")
;~ 	Local $aNumber = StringRegExp($sString, "(\d+)\D?(\d*)", 1)
	Local $aNumber = StringRegExp($sString, "(\D?\d+)\D?(\d*)", 1) ; This one works for negatives.
	If UBound($aNumber) = 2 Then
		Local $sLeft = $aNumber[0]
		While StringLen($sLeft)
			$sResult = $sThousands & StringRight($sLeft, 3) & $sResult
			$sLeft = StringTrimRight($sLeft, 3)
		WEnd
;~ 		$sResult = StringTrimLeft($sResult, 1) ; Strip leading thousands separator
		$sResult = StringTrimLeft($sResult, StringLen($sThousands)) ; Strip leading thousands separator
		If $aNumber[1] <> "" Then $sResult &= $sDecimal & $aNumber[1]
	EndIf
	Return $sResult
EndFunc   ;==>_StringAddThousandsSep
TomCat08 is offline  
Thanks
1 User
Old 04/20/2010, 22:47   #3
 
elite*gold: 0
Join Date: Feb 2010
Posts: 92
Received Thanks: 11
oh wow... so kompliziert hatt ich mir das nicht vorgestellt^^. aber thx
BotofWar is offline  
Reply


Similar Threads Similar Threads
Autoit quellcode Hilfe--funcktion error..missing separator character after keywords
02/27/2009 - Rappelz - 9 Replies
Hey Leute Habe nen Problem Also mein bot sollte eignt laufen tut er aber nich ..keine ahnung wieso nach mouseclick schliest er automatisch .. hier mal der quellcode MouseClick ("left",536, 367)



All times are GMT +1. The time now is 15:49.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.