Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Format problem

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-29-2009, 06:33 PM
Newbie
 
Join Date: Mar 2009
Posts: 4
Default Format problem

Why does Format(0.567,"F0") return 1? I would expect 0

The value seems to be rounded before formatting:
Format(0.467,"F0") brings 0

Artur
Reply With Quote
  #2 (permalink)  
Old 03-29-2009, 09:16 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

It's true that the format function rounds the value before formatting.

Quote:
Originally Posted by ArturAs View Post
Why does Format(0.567,"F0") return 1? I would expect 0
So what is the aim of your expected format? If you want only the value before the decimal point use
Int(0.567) => returns 0
Int(0.467) => returns 0
Int(1.000) => returns 1


specci48
Reply With Quote
  #3 (permalink)  
Old 03-30-2009, 11:18 AM
Newbie
 
Join Date: Mar 2009
Posts: 4
Default

Thank you, specci48,
i'll use this way.
Artur
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
faulty format Max Tillberg Questions (Windows Mobile) 2 03-08-2009 02:44 PM
Problem with CSV format ceaser Questions (Windows Mobile) 8 02-10-2009 03:38 AM
format exception dennishea Questions (Windows Mobile) 2 12-23-2007 07:36 AM
Database format Nycran Questions (Windows Mobile) 5 11-06-2007 05:42 AM
Date format problem Scubaticus Questions (Windows Mobile) 10 07-03-2007 05:32 PM


All times are GMT. The time now is 04:09 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0