NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
November 21, 2017, 02:24:45 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
"That their main business was not put into the mind knowledge which was not there before, but to turn the mind's eye towards light so that it might see for itself." ...Plato's advice to educators(429-347BC)
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: this is how to make display show in scientific format 0.00E00 like tracker  (Read 4410 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
on: August 10, 2010, 09:10:53 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

Format   
The format used to display the value, i.e. the number of decimal digits with which to display the value.   Type 0.0 with one or more zeros after the point.

http://www.um.es/fem/EjsWiki/Main/ElementsSlider

i just try 0.00E00 and it works!
cool man

Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #1 on: August 10, 2010, 09:13:19 pm » posted from:Singapore,,Singapore

Dear Ejs learning community

I have a question.

I have a custom function
double dv;
public String double2String(double v,double divider){
 if(v > 0)dv=0.5;
 else if(v < 0)dv=-0.5;
 else dv=0;
 return (int)(v*divider+dv)/divider+"";
}

the string called cannot display the values correctly
for example
s_E2 = " {g_net} = 6.67*10^{ - 11} *( " +double2String(m1,10.)+")"+"/("+double2String(x1-xtest,10.)+"){^2}" ;

how can the codes be modified to display in scientific form?

this doesn't work
s_E2 = " {g_net} = 6.67*10^{ - 11} *( " +double2String(m1,0.00E00)+")"+"/("+double2String(x1-xtest,0.00E00)+"){^2}" ;

any tips?

i think must rewrite the custom function but i don't know how to start Grin
or is there some open source physics function that can do this?


* errorwith00e00.png (2.12 KB, 266x81 - viewed 310 times.)

*** There are 1 more attached files. You need to login to acces it!
« Last Edit: August 10, 2010, 09:15:26 pm by lookang » Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #2 on: August 11, 2010, 08:05:48 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE

http://www.um.es/fem/EjsWiki/Main/ElementsSlider

edited the wiki to include

Format   
The format used to display the value, i.e. the number of decimal digits with which to display the value.   
Type 0.0 with one or more zeros after the point. or 0.00E00 for scientific notation   
Logged
Pages: [1]   Go Up
  Print  
"That their main business was not put into the mind knowledge which was not there before, but to turn the mind's eye towards light so that it might see for itself." ...Plato's advice to educators(429-347BC)
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
can the interface - field - format show special characters like alpha
Questions related to EJS
lookang 17 17983 Last post December 04, 2008, 05:10:51 pm
by lookang
how to make a Earth Globe realistic enough when view show correct orientation?
Questions related to EJS
lookang 0 5913 Last post January 03, 2009, 10:06:53 pm
by lookang
Tracker Free Video Analysis & Modeling Tool by Douglas Brown
Collaborative Community of EJS
lookang 21 61910 Last post May 05, 2017, 03:56:24 pm
by mxffiles
Tracker: image and video analysis package and modeling tool
Physics related resources
Fu-Kwun Hwang 2 11324 Last post November 15, 2010, 03:57:54 pm
by casualz
Using tracker to gather evidence of speed of Ferrari was at 216? or 140 km/hr?
Collaborative Community of EJS
lookang 4 12633 Last post May 19, 2012, 10:31:56 pm
by lookang
Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.057 seconds with 22 queries.since 2011/06/15