Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#441 closed Feature Request (Duplicate)

Proposed changes to _StringAddThousandsSep()

Reported by: anonymous Owned by: Gary
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: Cc:


This allows for regional settings.

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)
	If UBound($aNumber) = 2 Then
		Local $sLeft = $aNumber[0]
		While StringLen($sLeft)
			$sResult = $sThousands & StringRight($sLeft, 3) & $sResult
			$sLeft = StringTrimRight($sLeft, 3)
		$sResult = StringTrimLeft($sResult, StringLen($sThousands)) ; Strip leading thousands separator
		If $aNumber[1] <> "" Then $sResult &= $sDecimal & $aNumber[1]
	Return $sResult
EndFunc   ;==>_StringAddThousandsSep

Attachments (0)

Change History (2)

comment:1 Changed 16 years ago by Valik

  • Resolution set to Duplicate
  • Status changed from new to closed

Closing as duplicate of #442.

comment:2 Changed 16 years ago by TicketCleanup

  • Version deleted

Automatic ticket cleanup.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Gary.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.