Page 1 of 1

Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-03 19:42
by michael_d
Hallo Community,

ich habe ein kleines Problem und zwar folgendes. In meinen Scripten wird eine Zahl so dargestellt 1,023.0

Jedoch möchte ich das das Tausenderzeichen ein Punkt ist und die Kommastelle wirklich ein Komma ist also 1.023,0

Ich weiß es ist eine Newbie Frage aber jeder fängt mal klein an ;)

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-03 20:02
by Joe User
Wie sieht Dein ENV (LC_* und LANG) aus?

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-03 20:09
by michael_d
Joe User wrote:Wie sieht Dein ENV (LC_* und LANG) aus?
Verzeihst du mir wenn ich sage ich verstehe nur Bahnhof ?

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-04 00:49
by Roger Wilco
Michael_D wrote:
Joe User wrote:Wie sieht Dein ENV (LC_* und LANG) aus?
Verzeihst du mir wenn ich sage ich verstehe nur Bahnhof ?
Was gibt `locale` aus?

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-04 07:57
by michael_d
LANG=
LC_CTYPE=de_DE@euro
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-04 15:06
by sledge0303
Michael_D wrote:LANG=
LC_CTYPE=de_DE@euro
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
Bei mir steht unter LANG=de_DE@euro
Ã?ndere das mal entsprechend und dann dürfte es wie gewünscht funktionieren

S.

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-04 15:09
by michael_d
Und wieder eine " dumme " Frage wo ( Datei ) / Wie ändere ich dies ?

OS ist SUSE 9.1

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-04 15:29
by Joe User
/etc/sysconfig/language oder per YaST.

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-04 16:38
by michael_d
Ich komme nicht weiter. Egal was ich auswähle das Ergebnis bleibt das selbe:

Code: Select all

## Path:	System/Environment/Language
## Description:	
## Type:	string(POSIX,ca_ES.ISO-8859-1,ca_ES.UTF-8,cs_CZ.ISO-8859-2,cs_CZ.UTF-8,da_DE@euro,da_DK.ISO-8859-1,da_DK.UTF-8,de_DE@euro,de_DE.ISO-8859-1,de_DE.UTF-8,el_GR.ISO-8859-7,el_GR.UTF-8,en_GB.ISO-8859-1,en_GB.UTF-8,en_IE@euro,en_IE.ISO-8859-1,en_US.ISO-8859-1,es_ES@euro,es_ES.ISO-8859-1,es_ES.UTF-8,fr_FR@euro,fr_FR.ISO-8859-1,fr_FR.UTF-8,gl_ES@euro,gl_ES.ISO-8859-1,gl_ES.utf-8,hr_HR.ISO-8859-2,hu_HU.ISO-8859-2,hu_HU.UTF-8,it_IT@euro,it_IT.ISO-8859-1,it_IT.UTF-8,ja_JP.eucJP,ja_JP.UTF-8,lt_LT.ISO-8859-13,lt_LT.UTF-8,nl_NL@euro,nl_NL.ISO-8859-1,nl_NL.UTF-8,ru_RU.ISO-8859-5,ru_RU.KOI8R,ru_RU.UTF-8,sk_SK.ISO-8859-2,sk_SK.UTF-8,tr_TR.ISO-8859-9,tr_TR.UTF-8,ko_KR.eucKR,ko_KR.UTF-8,zh_TW.Big5,zh_TW.UTF-8,zh_CN.GB2312,zh_CN.UTF-8)
## Default:	""
## Config:      OpenOffice.org,groff,ispell,kde,kdm3,profiles,susehelp,susewm,tetex,wdm
#
#
# Local users will get RC_LANG as their default language, i.e. the
# environment variable $LANG . $LANG is the default of all $LC_*-variables,
# as long as $LC_ALL is not set, which overrides all $LC_-variables.
# Root uses this variable only if ROOT_USES_LANG is set to "yes".
#
RC_LANG="de_DE@euro"

## Type:	string
## Default:	""
#
# This variable will override all LC-variables!!
# Again, ROOT_USES_LANG must be set to "yes", if an effect on the superuser
# account is desired.
#
RC_LC_ALL="de_DE@euro"

## Type:	string
## Default:	""
#
# This defines the locale in which messages of programs and
# libraries with i18n-support should appear if a translated
# message catalog for the library or the program is installed.
# This also provides localized yes/no answers.
#
RC_LC_MESSAGES=""

## Type:	string
## Default:	""
#
# This defines the locale for character handling and classification.
# The libc uses this value in language dependent function calls, such
# as e.g. uppercase/lowercase mapping of foreign characters.
#
RC_LC_CTYPE=""

## Type:	string
## Default:	""
#
# This defines the locale for sorting strings and characters.
# It is used by the libc to obtain the alphabetical order of characters
# (e.g. for string comparisons).
#
RC_LC_COLLATE=""

## Type:	string
## Default:	""
#
# This defines the locale for date and time output formats.
# i.e.: 06/09/1999 vs. 09.06.1999
#
RC_LC_TIME=""

## Type:	string
## Default:	""
#
# This defines the locale for formatting and reading numbers.
# i.e.: 1,234.56 vs. 1.234,56
#
RC_LC_NUMERIC=""

## Type:	string
## Default:	""
#
# This defines the locale for formatting and reading money values.
#
RC_LC_MONETARY=""

## Type:	string(ctype)
## Default:	ctype
#
# This defines if the user "root" should use the locale settings
# which are defined here.
# Value "ctype" means that root uses just LC_CTYPE. 
#
ROOT_USES_LANG="ctype"

## Type:        yesno
## Default:     no
#
# Workaround for missing forward of LANG and LC variables
# of e.g. ssh login connections.
#
AUTO_DETECT_UTF8="no"
Ergebnis:

LANG=
LC_CTYPE="de_DE@euro"
LC_NUMERIC="de_DE@euro"
LC_TIME="de_DE@euro"
LC_COLLATE="de_DE@euro"
LC_MONETARY="de_DE@euro"
LC_MESSAGES="de_DE@euro"
LC_PAPER="de_DE@euro"
LC_NAME="de_DE@euro"
LC_ADDRESS="de_DE@euro"
LC_TELEPHONE="de_DE@euro"
LC_MEASUREMENT="de_DE@euro"
LC_IDENTIFICATION="de_DE@euro"
LC_ALL=de_DE@euro

Re: Trennzeichen für Tausenderzahlen ( Komma statt Punkt )

Posted: 2005-10-04 18:59
by oxygen
Statt die Server Konfiguration zu verändern würde ich eher das Script anpassen (So läuft es dann auch auf anderen Servern richtig). z.B. so (PHP):

Code: Select all

setlocale (LC_ALL, 'de_DE');
Allerdings kann das ganz auch Probleme mit MySQL nach sich ziehen wenn man z.B. in einem Query 10,4 statt 10.4 steht...