简体   繁体   中英

Shorcut in NetBeans or Eclipse for currency symbol

In Java, I can display currency in decimal format with currency symbol ¤

http://download.oracle.com/javase/tutorial/i18n/format/decimalFormat.html

In NetBeans and Eclipse, how to type this ¤ symbol. Actually in this question I do copy and paste.

To type a character like ¤ you would hold the Alt key down and type 0164 (tested on Windows).

In Windows you can see the Character Map by clicking the Start button and navigating to the Accessories folder where you will find a System Tools folder which contains the Character Map application.

On a Gnome system it is located in the Applications > Accessories > Character Map menu item

NetBeans Shortcut

One way to do this in NetBeans is to create a Code Template that will handle the expansion for you. To do this, click Tools > Options > Editor > Code Templates and create a new template with the ¤ character as the Expanded Text . Then you can use whatever Abbreviation that you defined for the Code Template and press the TAB button to expand it.

For example, I defined a new Code Template that used the Abbreviation of gc for the generic currency symbol. Now when I type gc and press TAB in the editor, it gets expanded to ¤ .

Eclipse Shortcut

To create a Code Template in Eclipse, go to the Preferences panel through Window > Preferences and expand the Java > Editor > Templates section. Once there, click the New.. button and fill out the Name , select a Context that the template will be available in and in the Pattern text area type the ¤ symbol.

To expand the template in whichever Context you chose, type (for example) gc and then use the Control + Space combination to expand the template. If other similar values map to the letters you've chosen then the code completion list will appear and you will need to select your template from the list.

On personal computers running the Microsoft Windows or DOS operating systems, additional characters to those available in the current keyboard layout can be typed using an Alt code : pressing and holding the Alt key while entering a character code with the keyboard's numeric keypad.

Often this is the best or only method many computer users know for entering non-ASCII characters.

You might want to see this : ALT CODES REFERENCE SHEET (This contains your ¤ and many more)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM