• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Separator for big Numbers (for ex. 123'456'789) instead of printing 123456789

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I tried to separate my java output with this Code in Eclipse:



But I always get the console output:


15?536?714?310?352?335?821?263?449?270?861

Why I get this sign "?" instead of " ' "??!! I want to see:

15'536'714'310'352'335'821'263'449'270'861

Pperhaps I had set the wrong code point in Eclipse. But I tried every known cp (850, 1252, ISO-8859-1, UTF-8, UTF-16) in Eclipse Windows-Preferences-Workspace but i've alwas the same wrong output. Perhaps it's an Eclipse problem because when I enter the source code in a text file and save it as Test.java and compile it with javac an run with java Test, the output is what I want: 15’536’714’310’352’335’821’263’449’270’861

I saw somewhere in a forum, that I can set the code point in the source code globally but I' forgot how and where I saw it. But I remember the Code started with system......

Thanks for your help in advance.

Mike
 
Saloon Keeper
Posts: 10528
224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

Nothing to do with character encoding.

The font that Eclipse uses for its output window probably just doesn't have a symbol for the grouping separator that is specific to your default locale.
 
Mike Gualeni
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the late reply!

I use a mac. But only in Eclipse I get the separator sign "?" Why?

Anybody knows what's going wrong?

Thanks.

Mike
 
Sheriff
Posts: 24635
56
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the question mark does indicate that the encoding you chose can't render that character.

Which is strange because the ' character is in the ASCII character set, and it's basically impossible to choose an encoding which doesn't extend ASCII. So you must have used some obscure character instead of the ordinary ' character.
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!