NumberFormat with SQLite or mySQL

2009-06-27 Thread Josep

Hi,

Any idea to change the point by comma in the decimal numbers? I convert each
query and each insert or update... exist other way?

Salut,
Josep
-- 
View this message in context: 
http://www.nabble.com/NumberFormat-with-SQLite-or-mySQL-tp24232124p24232124.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: numberFormat to datagrid

2009-06-23 Thread kl...@major.on-rev.com

Hi Josep,



Hi Klaus,

I have it in the FillData but nothing happen, all the values are  
showed with

6 decimal places..


hmmm, did work here, at least in an example button, not tested with a  
datagrid however.

Could you please post the complete handler? Just to be sure.


Salut,
Josep


Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.com




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: numberFormat to datagrid

2009-06-22 Thread Josep

Hi Klaus,

I have it in the FillData but nothing happen, all the values are showed with
6 decimal places..

Salut,
Josep 
-- 
View this message in context: 
http://www.nabble.com/numberFormat-to-datagrid-tp24152520p24156822.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: numberFormat to datagrid

2009-06-22 Thread Klaus on-rev

Hi Josep,


Hi list,

How to apply the "set the numberFormat to "#.000" into the  
datagrid ? I have
the numeric values with 6 positions for decimals but only I want  
show 3. I

put it into the FillData but nothing happen..

Any idea?


Yep :-)

"the numberformat" will only affect the result of a calculation.

So you could do this in your "fillData" handler:
...
set the numberFormat to "#.000
add 0 to your_value_here
...

That should do the job.


Salut,
Josep


Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


numberFormat to datagrid

2009-06-22 Thread Josep

Hi list,

How to apply the "set the numberFormat to "#.000" into the datagrid ? I have
the numeric values with 6 positions for decimals but only I want show 3. I
put it into the FillData but nothing happen..

Any idea?

Salut,
Josep
-- 
View this message in context: 
http://www.nabble.com/numberFormat-to-datagrid-tp24152520p24152520.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: date_Construct8601 (was numberformat)

2008-08-27 Thread william humphrey
Hey thanks. That will be a big help.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: date_Construct8601 (was numberformat)

2008-08-27 Thread BNig

Bill,

you could get there with this button script:
---
on mouseUp
   put 1000.13 into tNumber
   if tNumber is not a number then 
answer "this is not a number"
  exit mouseUp
   end if
   put offset (".", tNumber) into tDecimal
   if tDecimal > 0 then 
  put char 1 to tDecimal-1 of tNumber into tWhole
  put char tDecimal+1 to -1 of tNumber into tFraction
   else 
  put tNumber into tWhole
  put "00" into tFraction
   end if
   put the length of tWhole into tSolong
   put tSolong -2 into tStart
   repeat with i = tStart down to 4  step -3
  put "," before char i of tWhole
   end repeat
   put tWhole & "." & tFraction into field "f1"
end mouseUp


you would obviously need a field named "f1" for the script to work.
And you can not compute the formatted number without removing the commas.

this is not as smart as Sarah's script but it does the trick. 

regards

Bernd




BILL HUMPHREY wrote:
> 
> Can the format command be used to solve the common task of needing a
> number
> 000,000,000  (put the commas in)?
> 
> Or the format number like accountants
> 
> $  000,000,000.00   ?
> 
> I noticed it has the option for #.00 to set two decimal places but no add
> the commas or put a dollar sign.  I remember that in hypercard we had an
> external for this.
> 
> Thanks,
> 
> Bill
> 

-- 
View this message in context: 
http://www.nabble.com/date_Construct8601-%28was-numberformat%29-tp19169935p19191191.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: date_Construct8601 (was numberformat)

2008-08-27 Thread David Bovill
No - I don't think so.

2008/8/27 william humphrey <[EMAIL PROTECTED]>

> Can the format command be used to solve the common task of needing a number
> 000,000,000  (put the commas in)?
>
> Or the format number like accountants
>
> $  000,000,000.00   ?
>
> I noticed it has the option for #.00 to set two decimal places but no add
> the commas or put a dollar sign.  I remember that in hypercard we had an
> external for this.
>
> Thanks,
>
> Bill
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: date_Construct8601 (was numberformat)

2008-08-27 Thread william humphrey
Can the format command be used to solve the common task of needing a number
000,000,000  (put the commas in)?

Or the format number like accountants

$  000,000,000.00   ?

I noticed it has the option for #.00 to set two decimal places but no add
the commas or put a dollar sign.  I remember that in hypercard we had an
external for this.

Thanks,

Bill
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: date_Construct8601 (was numberformat)

2008-08-27 Thread David Bovill
Yeah - thanks Sarah - I've just been learning "format" and you beat me to it
:) There are a few other versions as some implementations don't use the full
standard - so I'll add those then post the handler. Its going to be much
easier to add them now just by using different format strings. I've stuck to
using standard Rev commands for decoding - as I just cant get binarydecode
to work :)

2008/8/27 Andre Garzia <[EMAIL PROTECTED]>

> Sarah and David,
>
> thank you very much, I was in need of that! :-D
>
> damn wordpress likes iso8601
>
> Cheers
> andre
>
> On Tue, Aug 26, 2008 at 9:16 PM, Sarah Reichelt
> <[EMAIL PROTECTED]> wrote:
> > Hi David,
> >
> > Here is my re-working of your function:
> >
> > function date_Construct8601 someDate, someTime, extended, isUTC
> >if someTime is empty then
> >-- returning date only
> >convert someDate to dateItems
> >put item 1 of someDate into y
> >put item 2 of someDate into mons
> >put item 3 of someDate into d
> >
> >convert someDate to internet date
> >if extended is true then
> >-- 1981-04-05
> >put "%4d-%02d-%02d" into baseString
> >else
> >-- 19810405
> >put "%4d%02d%02d" into baseString
> >end if
> >
> >put format(baseString, y, mons, d) into fDate
> >return fDate
> >
> >else
> >-- returning date & time as either local or UTC
> >convert (someDate && someTime) to internet date
> >put it into someDate
> >
> >put word -1 of someDate into utcOffset
> >
> >convert someDate to dateItems
> >put item 1 of someDate into y
> >put item 2 of someDate into mons
> >put item 3 of someDate into d
> >
> >put item 4 of someDate into h
> >put item 5 of someDate into mins
> >put item 6 of someDate into s
> >
> >if isUTC is true then
> >-- UTC specific code
> >put char 2 to 3 of utcOffset into extraHours
> >put char 4 to 5 of utcOffset into extraMin
> >
> >if char 1 of utcOffset is "-" then
> >add extraHours to h
> >add extraMin to m
> >else
> >subtract extraHours from h
> >subtract extraMin from m
> >end if
> >
> >if extended is true then
> >-- 1981-04-05T14:30:30-05:00
> >put "%4d-%02d-%02dT%02d:%02d:%02dZ" into baseString
> >else
> >-- 19810405T14:30:30-05 00
> >put "%4d%02d%02dT%02d:%02d:%02dZ" into baseString
> >end if
> >put format(baseString, y, mons, d, h, mins, s) into fDate
> >return fDate
> >
> >else
> >-- Local specific code
> >if extended is true then
> >-- 1981-04-05T14:30:30-05:00
> >put "%4d-%02d-%02dT%02d:%02d:%02d %04s" into baseString
> >else
> >-- 19810405T14:30:30-05 00
> >put "%4d%02d%02dT%02d:%02d:%02d%04s" into baseString
> >end if
> >
> >put format(baseString, y, mons, d, h, mins, s, utcOffset) into
> fDate
> >return fDate
> >end if
> >end if
> > end date_Construct8601
> >
> >
> > - instead of using your padding function and numberFormat, I just used
> > format to supply the leading zeroes as required.
> > - your UTC calculation was going the wrong way. I am in +1000 time
> > zone, and to get to UTC, I have to subtract 10 from the local hours,
> > not add.
> > - there was some code duplication between the UTC and local date/time
> > sections, so I re-organised the structure of the if-else-end if"s to
> > avoid this.
> >
> > Thanks for providing an interesting challenge :-)
> >
> > Cheers,
> > Sarah
> > ___
> > use-revolution mailing list
> > use-revolution@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
>
>
>
> --
> http://www.andregarzia.com All We Do Is Code.
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: date_Construct8601 (was numberformat)

2008-08-26 Thread Andre Garzia
Sarah and David,

thank you very much, I was in need of that! :-D

damn wordpress likes iso8601

Cheers
andre

On Tue, Aug 26, 2008 at 9:16 PM, Sarah Reichelt
<[EMAIL PROTECTED]> wrote:
> Hi David,
>
> Here is my re-working of your function:
>
> function date_Construct8601 someDate, someTime, extended, isUTC
>if someTime is empty then
>-- returning date only
>convert someDate to dateItems
>put item 1 of someDate into y
>put item 2 of someDate into mons
>put item 3 of someDate into d
>
>convert someDate to internet date
>if extended is true then
>-- 1981-04-05
>put "%4d-%02d-%02d" into baseString
>else
>-- 19810405
>put "%4d%02d%02d" into baseString
>end if
>
>put format(baseString, y, mons, d) into fDate
>return fDate
>
>else
>-- returning date & time as either local or UTC
>convert (someDate && someTime) to internet date
>put it into someDate
>
>put word -1 of someDate into utcOffset
>
>convert someDate to dateItems
>put item 1 of someDate into y
>put item 2 of someDate into mons
>put item 3 of someDate into d
>
>put item 4 of someDate into h
>put item 5 of someDate into mins
>put item 6 of someDate into s
>
>if isUTC is true then
>-- UTC specific code
>put char 2 to 3 of utcOffset into extraHours
>put char 4 to 5 of utcOffset into extraMin
>
>if char 1 of utcOffset is "-" then
>add extraHours to h
>add extraMin to m
>else
>subtract extraHours from h
>subtract extraMin from m
>end if
>
>if extended is true then
>-- 1981-04-05T14:30:30-05:00
>put "%4d-%02d-%02dT%02d:%02d:%02dZ" into baseString
>else
>-- 19810405T14:30:30-05 00
>put "%4d%02d%02dT%02d:%02d:%02dZ" into baseString
>end if
>put format(baseString, y, mons, d, h, mins, s) into fDate
>return fDate
>
>else
>-- Local specific code
>if extended is true then
>-- 1981-04-05T14:30:30-05:00
>put "%4d-%02d-%02dT%02d:%02d:%02d %04s" into baseString
>else
>-- 19810405T14:30:30-05 00
>    put "%4d%02d%02dT%02d:%02d:%02d%04s" into baseString
>end if
>
>put format(baseString, y, mons, d, h, mins, s, utcOffset) into 
> fDate
>return fDate
>end if
>end if
> end date_Construct8601
>
>
> - instead of using your padding function and numberFormat, I just used
> format to supply the leading zeroes as required.
> - your UTC calculation was going the wrong way. I am in +1000 time
> zone, and to get to UTC, I have to subtract 10 from the local hours,
> not add.
> - there was some code duplication between the UTC and local date/time
> sections, so I re-organised the structure of the if-else-end if"s to
> avoid this.
>
> Thanks for providing an interesting challenge :-)
>
> Cheers,
> Sarah
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: date_Construct8601 (was numberformat)

2008-08-26 Thread Sarah Reichelt
Hi David,

Here is my re-working of your function:

function date_Construct8601 someDate, someTime, extended, isUTC
if someTime is empty then
-- returning date only
convert someDate to dateItems
put item 1 of someDate into y
put item 2 of someDate into mons
put item 3 of someDate into d

convert someDate to internet date
if extended is true then
-- 1981-04-05
put "%4d-%02d-%02d" into baseString
else
-- 19810405
put "%4d%02d%02d" into baseString
end if

put format(baseString, y, mons, d) into fDate
return fDate

else
-- returning date & time as either local or UTC
convert (someDate && someTime) to internet date
put it into someDate

put word -1 of someDate into utcOffset

convert someDate to dateItems
put item 1 of someDate into y
put item 2 of someDate into mons
put item 3 of someDate into d

put item 4 of someDate into h
put item 5 of someDate into mins
put item 6 of someDate into s

if isUTC is true then
-- UTC specific code
put char 2 to 3 of utcOffset into extraHours
put char 4 to 5 of utcOffset into extraMin

if char 1 of utcOffset is "-" then
add extraHours to h
add extraMin to m
else
subtract extraHours from h
subtract extraMin from m
end if

if extended is true then
-- 1981-04-05T14:30:30-05:00
put "%4d-%02d-%02dT%02d:%02d:%02dZ" into baseString
else
-- 19810405T14:30:30-05 00
put "%4d%02d%02dT%02d:%02d:%02dZ" into baseString
end if
put format(baseString, y, mons, d, h, mins, s) into fDate
return fDate

else
-- Local specific code
if extended is true then
-- 1981-04-05T14:30:30-05:00
put "%4d-%02d-%02dT%02d:%02d:%02d %04s" into baseString
else
-- 19810405T14:30:30-05 00
put "%4d%02d%02dT%02d:%02d:%02d%04s" into baseString
end if

put format(baseString, y, mons, d, h, mins, s, utcOffset) into fDate
return fDate
end if
end if
end date_Construct8601


- instead of using your padding function and numberFormat, I just used
format to supply the leading zeroes as required.
- your UTC calculation was going the wrong way. I am in +1000 time
zone, and to get to UTC, I have to subtract 10 from the local hours,
not add.
- there was some code duplication between the UTC and local date/time
sections, so I re-organised the structure of the if-else-end if"s to
avoid this.

Thanks for providing an interesting challenge :-)

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread David Bovill
Great!

2008/8/26 Mark Smith <[EMAIL PROTECTED]>

> David, you need "%02d".
>
> Best,
>
> Mark
>
>
> On 26 Aug 2008, at 21:20, David Bovill wrote:
>
>  2008/8/26 Mark Smith <[EMAIL PROTECTED]>
>>
>>  The docs say "It affects numbers only when they are calculated and then
>>> displayed or used as strings."
>>>
>>> I found that if you use >> padedNum>
>>>
>>> this forces padedNum to be a string, and you get '08'
>>>
>>> I've always found the numberFormat thing confusing, so I always use
>>> 'format' in these cases...
>>>
>>
>>
>> Hi mark -  I'm moving over  a date function to use "format" - but in the
>> docs I could not figure how to make it add trailing zeros? "%2d" did not
>> seem to work:
>>
>>if extended is true then
>>-- 1981-04-05T14:30:30-05:00
>>put "%4s-%2s-%2sT%2s:%2s:%2s-%4s" into baseString
>>else
>>-- 19810405T14:30:30-05 00
>>put "%4s%2s%2sT%2s:%2s:%2s %4s" into baseString
>>end if
>>
>>put format(baseString, y, mons, d, h, mins, s, z) into fDate
>>
>>  What should I usee?
>> ___
>> use-revolution mailing list
>> use-revolution@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread Mark Smith

David, you need "%02d".

Best,

Mark

On 26 Aug 2008, at 21:20, David Bovill wrote:


2008/8/26 Mark Smith <[EMAIL PROTECTED]>

The docs say "It affects numbers only when they are calculated and  
then

displayed or used as strings."

I found that if you use padedNum>


this forces padedNum to be a string, and you get '08'

I've always found the numberFormat thing confusing, so I always use
'format' in these cases...



Hi mark -  I'm moving over  a date function to use "format" - but  
in the
docs I could not figure how to make it add trailing zeros? "%2d"  
did not

seem to work:

if extended is true then
-- 1981-04-05T14:30:30-05:00
put "%4s-%2s-%2sT%2s:%2s:%2s-%4s" into baseString
else
-- 19810405T14:30:30-05 00
put "%4s%2s%2sT%2s:%2s:%2s %4s" into baseString
end if

put format(baseString, y, mons, d, h, mins, s, z) into fDate

 What should I usee?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


date_Construct8601 (was numberformat)

2008-08-26 Thread David Bovill
FYI- her is the function so far:

function date_Construct8601 someDate, someTime, extended, isUTC
if someTime is empty then
convert someDate to dateItems
put item 1 of someDate into y
put date_PadTwoZeros(item 2 of someDate) into mons
put date_PadTwoZeros(item 3 of someDate) into d

convert someDate to internet date
if extended is true then
-- 1981-04-05
put "%4s-%2s-%2s" into baseString
else
-- 19810405
put "%4s%2s%2s" into baseString
end if

set the numberformat to "00.##"
put format(baseString, y, mons, d) into fDate
set the numberformat to "0.##"
return fDate
else if isUTC is true then
convert (someDate && someTime) to internet date
put it into someDate

put word -1 of someDate into utcOffset
put char 2 to 3 of utcOffset into extraHours
put char 4 to 5 of utcOffset into extraMin

convert someDate to dateItems
put item 1 of someDate into y
put date_PadTwoZeros(item 2 of someDate) into mons
put date_PadTwoZeros(item 3 of someDate) into d

put item 4 of someDate into h
put item 5 of someDate into mins
put item 6 of someDate into s

if char 1 of utcOffset is "+" then
add extraHours to h
add extraMin to m
else
subtract extraHours from h
subtract extraMin from m
end if

put date_PadTwoZeros(h) into h
put date_PadTwoZeros(mins) into mins
put date_PadTwoZeros(s) into s

if extended is true then
-- 1981-04-05T14:30:30-05:00
put "%4s-%2s-%2sT%2s:%2s:%2sZ" into baseString
else
-- 19810405T14:30:30-05 00
put "%4s%2s%2sT%2s:%2s:%2sZ" into baseString
end if
put format(baseString, y, mons, d, h, mins, s) into fDate
return fDate
else
convert (someDate && someTime) to internet date
put it into someDate
put word -1 of someDate into z

convert someDate to dateItems
put item 1 of someDate into y
put date_PadTwoZeros(item 2 of someDate) into mons
put date_PadTwoZeros(item 3 of someDate) into d
put date_PadTwoZeros(item 4 of someDate) into h
put date_PadTwoZeros(item 5 of someDate) into mins
put date_PadTwoZeros(item 6 of someDate) into s

if extended is true then
-- 1981-04-05T14:30:30-05:00
put "%4s-%2s-%2sT%2s:%2s:%2s %4s" into baseString
else
-- 19810405T14:30:30-05 00
    put "%4s%2s%2sT%2s:%2s:%2s%4s" into baseString
end if

set the numberformat to "00.##"
put format(baseString, y, mons, d, h, mins, s, z) into fDate
set the numberformat to "0.##"
return fDate
end if
end date_Construct8601
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread David Bovill
Hi William - the functions I'm posting are examples of a much more
complicated function I am trying to update / simplify. Its real ugly uless I
can use the nice built in "format" functions :)

2008/8/26 william humphrey <[EMAIL PROTECTED]>

> Spoke to soon
> try
>
> put "0" & "8" + 2
>
>
> and this works with the padded zero like you want. Much simpler than hard
> to
> understand add zero thing.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread David Bovill
2008/8/26 Mark Smith <[EMAIL PROTECTED]>

> The docs say "It affects numbers only when they are calculated and then
> displayed or used as strings."
>
> I found that if you use 
>
> this forces padedNum to be a string, and you get '08'
>
> I've always found the numberFormat thing confusing, so I always use
> 'format' in these cases...


Hi mark -  I'm moving over  a date function to use "format" - but in the
docs I could not figure how to make it add trailing zeros? "%2d" did not
seem to work:

if extended is true then
-- 1981-04-05T14:30:30-05:00
put "%4s-%2s-%2sT%2s:%2s:%2s-%4s" into baseString
else
-- 19810405T14:30:30-05 00
put "%4s%2s%2sT%2s:%2s:%2s %4s" into baseString
end if

put format(baseString, y, mons, d, h, mins, s, z) into fDate

 What should I usee?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread william humphrey
Spoke to soon
try

put "0" & "8" + 2


and this works with the padded zero like you want. Much simpler than hard to
understand add zero thing.

On Tue, Aug 26, 2008 at 3:55 PM, william humphrey <[EMAIL PROTECTED]>wrote:

> And if you do what I say it stops being a number and becomes a text string?
>
>
> On Tue, Aug 26, 2008 at 3:54 PM, Colin Holgate <[EMAIL PROTECTED]> wrote:
>
>> At 8:46 PM +0100 8/26/08, David Bovill wrote:
>>
>>>  > set the numberformat to "00.##"
>>>
>>>> put item 1 of someNum + 0 into padedNum
>>>>
>>>  > set the numberformat to "0.##"
>>>
>>
>> I think the problem is that the numberformat only affects how the number
>> appears, not what it is. Because you set it back to "0.##", what would
>> have been 08 becomes 8. padeNum contains the value of 8, not the string of
>> "08".
>>
>>
>>
>>
>> ___
>> use-revolution mailing list
>> use-revolution@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
>
>
> --
> http://www.bluewatermaritime.com
>



-- 
http://www.bluewatermaritime.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread Mark Smith
The docs say "It affects numbers only when they are calculated and  
then displayed or used as strings."


I found that if you use padedNum>


this forces padedNum to be a string, and you get '08'

I've always found the numberFormat thing confusing, so I always use  
'format' in these cases...


Best,

Mark

On 26 Aug 2008, at 20:46, David Bovill wrote:


I get a "8".

Here I've extracted this function:

function date_PadTwoZeros someNum

set the numberformat to "00.##"
put item 1 of someNum + 0 into padedNum
set the numberformat to "0.##"
return padedNum
end date_PadTwoZeros

put date_PadTwoZeros("8") --> "8"

function date_PadTwoZeros someNum
if the number of chars of someNum = 1 then
return "0" & someNum
else
return someNum
end if
end date_PadTwoZeros

put date_PadTwoZeros("8") --> "08"


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread william humphrey
And if you do what I say it stops being a number and becomes a text string?

On Tue, Aug 26, 2008 at 3:54 PM, Colin Holgate <[EMAIL PROTECTED]> wrote:

> At 8:46 PM +0100 8/26/08, David Bovill wrote:
>
>>  > set the numberformat to "00.##"
>>
>>> put item 1 of someNum + 0 into padedNum
>>>
>>  > set the numberformat to "0.##"
>>
>
> I think the problem is that the numberformat only affects how the number
> appears, not what it is. Because you set it back to "0.##", what would
> have been 08 becomes 8. padeNum contains the value of 8, not the string of
> "08".
>
>
>
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.bluewatermaritime.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread Colin Holgate

At 8:46 PM +0100 8/26/08, David Bovill wrote:

 > set the numberformat to "00.##"

 put item 1 of someNum + 0 into padedNum

 > set the numberformat to "0.##"


I think the problem is that the numberformat only affects how the 
number appears, not what it is. Because you set it back to 
"0.##", what would have been 08 becomes 8. padeNum contains the 
value of 8, not the string of "08".




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread william humphrey
I don't get it. Why not just say put "0" & "1" into
text-string-with-zero-in-the-front.

Why would adding a zero do that?

On Tue, Aug 26, 2008 at 3:48 PM, Mark Schonewille <
[EMAIL PROTECTED]> wrote:

> Hi David,
>
> I tried the following script:
>
> on mouseUp
>   beep
>   put 1,8 into someDate
>   set the numberformat to "00.##"
>   put item 1 of someDate + 0 into y
>   put item 2 of someDate + 0 into someMonth
>   put y & cr & someMonth
> end mouseUp
>
> which gives me
>
> 01
> 08
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> http://economy-x-talk.com
> http://www.salery.biz
> http://facebook.economy-x-talk.com
>
> Benefit from our inexpensive hosting services. See
> http://economy-x-talk.com/server.html for more info.
>
>
> On 26 aug 2008, at 21:31, David Bovill wrote:
>
>  I can never get this working... or has something changed? I want a number
>> formatted to 2 chars and padded with leading zeros if it is only 1 digit.
>> I
>> thought numberformat did this (for containers as well as fields by forcing
>> a
>> calculation by adding zero. So:
>>
>>   set the numberformat to "00.##"
>>   put item 1 of someDate + 0 into y
>>   put item 2 of someDate + 0 into someMonth
>>
>> Well its not working now. I get "8" instead of "08" for this month?
>>
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.bluewatermaritime.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread Mark Schonewille

Hi David,

I tried the following script:

on mouseUp
   beep
   put 1,8 into someDate
   set the numberformat to "00.##"
   put item 1 of someDate + 0 into y
   put item 2 of someDate + 0 into someMonth
   put y & cr & someMonth
end mouseUp

which gives me

01
08

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
http://facebook.economy-x-talk.com

Benefit from our inexpensive hosting services. See http://economy-x-talk.com/server.html 
 for more info.


On 26 aug 2008, at 21:31, David Bovill wrote:

I can never get this working... or has something changed? I want a  
number
formatted to 2 chars and padded with leading zeros if it is only 1  
digit. I
thought numberformat did this (for containers as well as fields by  
forcing a

calculation by adding zero. So:

   set the numberformat to "00.##"
   put item 1 of someDate + 0 into y
   put item 2 of someDate + 0 into someMonth

Well its not working now. I get "8" instead of "08" for this month?


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread David Bovill
I get a "8".

Here I've extracted this function:

function date_PadTwoZeros someNum
> set the numberformat to "00.##"
> put item 1 of someNum + 0 into padedNum
> set the numberformat to "0.##"
> return padedNum
> end date_PadTwoZeros
>
> put date_PadTwoZeros("8") --> "8"
>
> function date_PadTwoZeros someNum
> if the number of chars of someNum = 1 then
> return "0" & someNum
> else
> return someNum
> end if
> end date_PadTwoZeros
>
> put date_PadTwoZeros("8") --> "08"
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Numberformat

2008-08-26 Thread Richard Gaskin

David Bovill wrote:

I can never get this working... or has something changed? I want
a number
formatted to 2 chars and padded with leading zeros if it is only
1 digit. I
thought numberformat did this (for containers as well as fields
by forcing a
calculation by adding zero. So:

set the numberformat to "00.##"
put item 1 of someDate + 0 into y
put item 2 of someDate + 0 into someMonth

Well its not working now. I get "8" instead of "08" for this
month?


What happens in your script after the last line you posted?

--
 Richard Gaskin
 Managing Editor, revJournal
 ___
 Rev tips, tutorials and more: http://www.revJournal.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Numberformat

2008-08-26 Thread David Bovill
I can never get this working... or has something changed? I want a number
formatted to 2 chars and padded with leading zeros if it is only 1 digit. I
thought numberformat did this (for containers as well as fields by forcing a
calculation by adding zero. So:

set the numberformat to "00.##"
put item 1 of someDate + 0 into y
put item 2 of someDate + 0 into someMonth

Well its not working now. I get "8" instead of "08" for this month?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Having problems with numberformat....

2006-11-02 Thread Dar Scott


On Nov 2, 2006, at 4:17 PM, David Bovill wrote:


Does 'put it into msg' work?



No - same. But I need the 12 digit value passed to AppleScript -  
the message

box was just an example. So it looks like I can do this with "& empty"
tagged on just before I need the result. Thanks for the help.


OK.  Put that into bugzilla when you get a chance and are comfortable  
with that.


Curious.  What version and what OS?  (should you have time...I can  
get it from the bug report.)


When you create the text for the 'do' you will be using '&', so you  
should not need to do that.  But since your stuff is acting weird,  
I'm not sure.


Dar

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Having problems with numberformat....

2006-11-02 Thread David Bovill

On 02/11/06, Dar Scott <[EMAIL PROTECTED]> wrote:



Does 'put it into msg' work?



No - same. But I need the 12 digit value passed to AppleScript - the message
box was just an example. So it looks like I can do this with "& empty"
tagged on just before I need the result. Thanks for the help.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Having problems with numberformat....

2006-11-02 Thread Dar Scott


On Nov 2, 2006, at 3:17 PM, David Bovill wrote:


   put it & empty



I think this is a bug - no?


Yes.

But this might be understandable.

It looks as though 'put it' will not (always) apply numberFormat and  
'it & empty' will.  (BTW, the latter is a common way to force  
numberFormat in computation, so you are on the right track.)


It looks as though 'put x' is compiled somewhat like an ordinary  
command and the number is passed as a parameter without number  
formatting as would be the case with most commands.  The message box  
is partially implemented in scripts.  I'm afraid I don't know how  
what gets compiled gets translated to some field in a stack.


Does 'put it into msg' work?

Dar



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Having problems with numberformat....

2006-11-02 Thread David Bovill

Hi Dar!

On 01/11/06, Dar Scott <[EMAIL PROTECTED]> wrote:



By the way, the numberFormat setting is not needed for a level of
arithmetic accuracy.  The result of arithmetic is always about 15
digits.  The numberFormat comes into play the first time the result
of arithmetic is used as text.



OK

The result of arithmetic will also pass as parameters just fine

(though converted to text with numberFormat coming into play when
passed using send).



Great

Literals do not need the zeros out to 12 places.


So numberFormat is not used until the final result is put into the
message box.  This should generate the same result:

on mouseDoubleUp
   put 0.006911491563 into projectedWidth
   get -1 * projectedWidth
   set the numberformat to "#."
   put it
end mouseDoubleUp



This is not working. Not in a fresh button in a new stack and AFAIK nothing
to do with any libraries (I am using OSX 10.4.8 and Rev 2.7.4). In
otherwords the output of this script is:

 -0.006911

and not:

 -0.006911491563

I can get around it by adding and empty space as in the following script:

on mouseUp
   put 0.006911491563 into projectedWidth
   get -1 * projectedWidth
   set the numberformat to "#."
   put it & empty
end mouseUp

which outputs:

   -0.006911491563

In previous versions ading zero to the number had the effect of forcing the
number to be formatted. Now as you state this only happens when treating the
number as a string - ie putting it into a field or doing a string
maniplulation. As I am sending it to another application using AppleScript -
I got caught. I think this is a bug - no?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Having problems with numberformat....

2006-11-01 Thread Dar Scott


On Nov 1, 2006, at 8:57 PM, David Bovill wrote:

Well I am stuck. I have not idea why it does not work. I cannot  
pass these
12 place decimals as parameters and why the script below does not  
work beats

me :(


By the way, the numberFormat setting is not needed for a level of  
arithmetic accuracy.  The result of arithmetic is always about 15  
digits.  The numberFormat comes into play the first time the result  
of arithmetic is used as text.


The result of arithmetic will also pass as parameters just fine  
(though converted to text with numberFormat coming into play when  
passed using send).


Literals do not need the zeros out to 12 places.

So numberFormat is not used until the final result is put into the  
message box.  This should generate the same result:


on mouseDoubleUp
  put 0.006911491563 into projectedWidth
  get -1 * projectedWidth
  set the numberformat to "#."
  put it
end mouseDoubleUp

Maybe you have some similar handler in a front script or in a button  
or something that is fooling with this.


Dar
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Having problems with numberformat....

2006-11-01 Thread Dar Scott


On Nov 1, 2006, at 8:57 PM, David Bovill wrote:

Well I am stuck. I have not idea why it does not work. I cannot  
pass these
12 place decimals as parameters and why the script below does not  
work beats

me :(


This works fine for me.  I'm on PPC OS X 10.4.7 using Rev 2.7.4.

I hope that is a clue.

Dar
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Having problems with numberformat....

2006-11-01 Thread Sarah Reichelt

Hi David,

I was able to replicate your result, but it seems to be related to
putting the value into the message box. If I do this:

   set the numberformat to "#."
   put 0.006911491563 into projectedWidth
   put -1. * projectedWidth into field 1

Then "field 1" contains -0.006911491563

HTH,
Sarah


On 11/2/06, David Bovill <[EMAIL PROTECTED]> wrote:

Well I am stuck. I have not idea why it does not work. I cannot pass these
12 place decimals as parameters and why the script below does not work beats
me :(

On 01/11/06, David Bovill <[EMAIL PROTECTED]> wrote:
>
> I am puzzled... I"m dealing with numbers to 12 decimal places, so when
> doing maths on them I nedd to set the number format first to deal with this
> level of accuracy - fine, except I can"t figure it - sometimes it is working
> and sometimes not :(
>
> Here is my test script:
>
> on mouseDoubleUp
> set the numberformat to "#."
> put 0.006911491563 into projectedWidth
> put -1. * projectedWidth
> end mouseDoubleUp
>
> When I pasted this on a new stacks card script and doule click I get:
>
>   -0.006911
>
> When I paste the 3 lines of the handler into the message box - I get what
> i would expect:
>
>   -0.006911491563
>
> Why???
>
>
>
>
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Having problems with numberformat....

2006-11-01 Thread David Bovill

Well I am stuck. I have not idea why it does not work. I cannot pass these
12 place decimals as parameters and why the script below does not work beats
me :(

On 01/11/06, David Bovill <[EMAIL PROTECTED]> wrote:


I am puzzled... I"m dealing with numbers to 12 decimal places, so when
doing maths on them I nedd to set the number format first to deal with this
level of accuracy - fine, except I can"t figure it - sometimes it is working
and sometimes not :(

Here is my test script:

on mouseDoubleUp
set the numberformat to "#."
put 0.006911491563 into projectedWidth
put -1. * projectedWidth
end mouseDoubleUp

When I pasted this on a new stacks card script and doule click I get:

  -0.006911

When I paste the 3 lines of the handler into the message box - I get what
i would expect:

  -0.006911491563

Why???






___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Having problems with numberformat....

2006-11-01 Thread David Bovill

I am puzzled... I"m dealing with numbers to 12 decimal places, so when doing
maths on them I nedd to set the number format first to deal with this level
of accuracy - fine, except I can"t figure it - sometimes it is working and
sometimes not :(

Here is my test script:

on mouseDoubleUp
   set the numberformat to "#."
   put 0.006911491563 into projectedWidth
   put -1. * projectedWidth
end mouseDoubleUp

When I pasted this on a new stacks card script and doule click I get:

 -0.006911

When I paste the 3 lines of the handler into the message box - I get what i
would expect:

 -0.006911491563

Why???
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


numberFormat

2006-03-22 Thread liamlambert

Thanks Chipp
Liam Lambert
[EMAIL PROTECTED]
IRELAND


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: numberFormat

2006-03-22 Thread Chipp Walters

Hi Liam,

You need to perform a math action on it first.

So, do:

put it into tShowid
add 0 to tShowID

should do it.

liamlambert wrote:

I have this bit of code the numberFormat
is not giving me two zeros after the decimal point
Why ???
thanks in advance

global gConID
 get fld "showid"
  put it into tshowid
  set the numberFormat to "#0.00"
  put "SELECT sum (child) FROM Booking where showid = '"& tshowid &  "'" 
into tChild

  put revdb_querylist(,,gConID,tChild) into tcSeats
  put tCseats into fld "child"
  put "SELECT sum (adult) FROM Booking where showid = '"& tshowid &  "'" 
into tAdult

  put revdb_querylist(,,gConID,tAdult) into tAseats
  put tAseats into fld "Adult"
  put "SELECT sum (cashDb) FROM Booking where showid = '"& tshowid &  
"'" into tCash

  put revdb_querylist(,,gConID,tCash) into tCashFld
  put tCashFld into fld "cash"

Liam Lambert
[EMAIL PROTECTED]
IRELAND


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution




--
--
Chipp Walters
www.altuit.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


numberFormat

2006-03-22 Thread liamlambert

I have this bit of code the numberFormat
is not giving me two zeros after the decimal point
Why ???
thanks in advance

global gConID
 get fld "showid"
  put it into tshowid
  set the numberFormat to "#0.00"
  put "SELECT sum (child) FROM Booking where showid = '"& tshowid &  
"'" into tChild

  put revdb_querylist(,,gConID,tChild) into tcSeats
  put tCseats into fld "child"
  put "SELECT sum (adult) FROM Booking where showid = '"& tshowid &  
"'" into tAdult

  put revdb_querylist(,,gConID,tAdult) into tAseats
  put tAseats into fld "Adult"
  put "SELECT sum (cashDb) FROM Booking where showid = '"& tshowid &  
"'" into tCash

  put revdb_querylist(,,gConID,tCash) into tCashFld
  put tCashFld into fld "cash"

Liam Lambert
[EMAIL PROTECTED]
IRELAND


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


NumberFormat

2006-01-17 Thread liamlambert

Thank's  * 2
Liam Lambert
[EMAIL PROTECTED]
IRELAND


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: NumberFormat

2006-01-17 Thread Eric Chatonet

Hi Liam,

Specifying the numberFormat is not enough:
If you want the numberFormat applied, you *must* make any numeric  
calculation :-)

For instance:

put tFinalTotal * 1 into fld "FinalTotal"

Le 17 janv. 06 à 17:44, liamlambert a écrit :



Hi all
I am calling a col total from a data Base  and not getting the  
right format

Say the Total is 100.50
I am getting 100.5

this is the code



set the numberFormat to "00.00"
get fld "showid"
put it into tshowid
 put "SELECT sum (total) FROM showDb where showid = '"& tshowid &  
"'" into tTotal

 put revdb_querylist(,,gConID,tTotal) into tFinalTotal
 put tFinalTotal into fld "FinalTotal"


Best Regards from Paris,
Eric Chatonet
 
--

http://www.sosmartsoftware.com/[EMAIL PROTECTED]/


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


NumberFormat

2006-01-17 Thread liamlambert


Hi all
I am calling a col total from a data Base  and not getting the right  
format

Say the Total is 100.50
I am getting 100.5

this is the code



set the numberFormat to "00.00"
get fld "showid"
put it into tshowid
 put "SELECT sum (total) FROM showDb where showid = '"& tshowid &  
"'" into tTotal

 put revdb_querylist(,,gConID,tTotal) into tFinalTotal
 put tFinalTotal into fld "FinalTotal"

Thank's
Liam Lambert
[EMAIL PROTECTED]
IRELAND


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: NumberFormat in field

2004-04-11 Thread Dom
Gray Steifel <[EMAIL PROTECTED]> wrote:

> How, if possible, does this work in Revolution?

There is nothing as practical in RR ;-)
Though, you use the "format" function, as below:

In a "budget" stack, I have two sets of flds
the first one to note the expenses by category, one by line
the second set contains sums by category (the name prefixed par a "s")
the summation is provoked by a closefield 
(handler placed in the group script)
to use the "sum" function I have to replace the cr by comma

=
on closefield  
  put the short name of the target into lechamp
  replace comma with "." in fld lechamp 
-- to replace the comma used here in Europe
  put fld lechamp into montants
  replace return with comma in montants
  put "S" & lechamp into letotal
  put format("%3.2f",sum(montants)) into fld letotal
end closefield



-- 
Vous parlez français ? faites un tour sur le groupe francophone !
[EMAIL PROTECTED]
Jetez un oeil sur RevoBlog  !
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: NumberFormat in field

2004-04-10 Thread Dar Scott
On Saturday, April 10, 2004, at 05:17 PM, Dar Scott wrote:

The global numberFormat property comes into play whenever the result 
of a math operation or math function application is used as a string, 
as in the case when it is put into a field, used as an array key, or 
used with the '&' operator.
I goofed.  Though numberFormat is not associated with an object, it is 
not global in Revolution; it is local to a handler and even to a 
particular call of the function or command.

Dar Scott



___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: NumberFormat in field

2004-04-10 Thread Dar Scott
On Saturday, April 10, 2004, at 02:40 PM, Gray Steifel wrote:

Converted a Hcard accounting program to Rev., where I use extensively 
the
“set numberFormat to 0.00” for all fields with numbers and/or the data 
sent
to the field.

How, if possible, does this work in Revolution?
The global numberFormat property comes into play whenever the result of 
a math operation or math function application is used as a string, as 
in the case when it is put into a field, used as an array key, or used 
with the '&' operator.

Dar Scott



___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


NumberFormat in field

2004-04-10 Thread Gray Steifel
Hello,
Converted a Hcard accounting program to Rev., where I use extensively the
³set numberFormat to 0.00² for all fields with numbers and/or the data sent
to the field.

How, if possible, does this work in Revolution?

Thanks,
Gray in Greensboro
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: seconds to standard time numberformat?

2003-08-24 Thread Monte Goulding

> >
> > Hi
> >
> > You've had quite a number of solutions but here's
> > another one:
> >
> > -- function to return the the time format (h:mm:ss)
> > from an input in seconds
> > function timeFormat timeInSecs
> >   if timeInSecs = 0 then
> > put "0:00:00" into timeInForm
> >   else
> > put format("%1d:%2d:%2d", timeInSecs div 60 div
> > 60, timeInSecs div 60
> > mod 60, timeInSecs mod 60) into timeInForm
> > repeat with x = 1 to the number of chars of
> > timeInForm
> >   if char X of timeInForm is space then
> > put 0 into char X of timeInForm
> >   end if
> > end repeat
> >   end if
> >   return timeInForm
> > end timeFormat
> >
> > Cheers
> >
> > Monte
> >
>
> You can shave off a few lines by replacing the "repeat
> with X = 1 to ..." - loop with
>   replace space with "0" in timeInForm
> But I think our fellow listee has many, many options
> to choose from now :-)
>
> Jan Schenkel.

Thanks Jan

That's one I wrote in my early days with MC and haven't looked at since
because it works. Will make the change though ;-)

Cheers

Monte

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: seconds to standard time numberformat?

2003-08-22 Thread Jan Schenkel
--- Monte Goulding <[EMAIL PROTECTED]>
wrote:
> 
> Hi
> 
> You've had quite a number of solutions but here's
> another one:
> 
> -- function to return the the time format (h:mm:ss)
> from an input in seconds
> function timeFormat timeInSecs
>   if timeInSecs = 0 then
> put "0:00:00" into timeInForm
>   else
> put format("%1d:%2d:%2d", timeInSecs div 60 div
> 60, timeInSecs div 60
> mod 60, timeInSecs mod 60) into timeInForm
> repeat with x = 1 to the number of chars of
> timeInForm
>   if char X of timeInForm is space then
> put 0 into char X of timeInForm
>   end if
> end repeat
>   end if
>   return timeInForm
> end timeFormat
> 
> Cheers
> 
> Monte
> 

You can shave off a few lines by replacing the "repeat
with X = 1 to ..." - loop with
  replace space with "0" in timeInForm
But I think our fellow listee has many, many options
to choose from now :-)

Jan Schenkel.

=
"As we grow older, we grow both wiser and more foolish at the same time."  (La 
Rochefoucauld)

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: seconds to standard time numberformat?

2003-08-22 Thread J. Landman Gay
On 8/22/03 12:45 PM, [EMAIL PROTECTED] wrote:

   This will give you results like "10:53:12 PM" -- that is, you'll get the 
hour, minute, second *and* whether it's AM or PM. Of course, your original 
question didn't mention the AM/PM bit at all; since the "long time" time format 
automatically includes the AM/PM bit, we must needs find a different way to do 
it if we don't want to deal with AM/PM. Fortunately, the dateItems time/date 
format gives you everything you need on a silver platter, or at least in a 
comma-delimited list whose individual parts you can access thru "item X of 
TheTime". 
Or even easier, make use of the twelveHourTime property:

set the twelvehourtime to false
get the seconds
convert it to long time
put it
Yields the desired format in military time. No dateItems needed. ;)

--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: seconds to standard time numberformat?

2003-08-22 Thread Mark Swindell
Cubist,

Thanks for the  tutorial on date/time conversion!

You should send this to the tips section of Runrev.

In fact, the PM was displaying in my scenario I posted a few minutes 
ago, but my field was too small to show it.  My use is for short  timed 
practice tests, so it's not appropriate to have AM/PM.  Again, thanks.

Mark

On Friday, August 22, 2003, at 10:45  AM, [EMAIL PROTECTED] gave a great 
date/time conversion explanation:

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: seconds to standard time numberformat?

2003-08-22 Thread Mark Swindell
Thanks for the speedy responses!  Much appreciated.  This snippet 
displays what I wanted.

on upDateTimer
   global gtheSecs,gtheSecsLong	
add 1 to gtheSecs
put  gtheSecs into gtheSecsLong
convert gtheSecsLong  to long time
put empty into char 1 to 2 of gtheSecsLong -- removes initial hour 
and colon, leaves minutes and seconds
put gtheSecsLong into field "Time"
send "updateTimer" to me in 1 second
end upDateTimer

Mark

On Friday, August 22, 2003, at 09:11  AM, J. Landman Gay wrote:

Is there a numberformat or other option that will display seconds in 
standard 00:00:00 format?
get the seconds
convert it to long time
put it
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: seconds to standard time numberformat?

2003-08-22 Thread Cubist
sez [EMAIL PROTECTED]:
>Is there a numberformat or other option that will display seconds in 
>standard 00:00:00 format?
   The CONVERT function is your friend for all things related to display of 
time and/or dates. To a first approximation:

function Sec2Standard DaSecs
   convert DaSecs from seconds to long time
   return DaSecs
end Sec2Standard

   This will give you results like "10:53:12 PM" -- that is, you'll get the 
hour, minute, second *and* whether it's AM or PM. Of course, your original 
question didn't mention the AM/PM bit at all; since the "long time" time format 
automatically includes the AM/PM bit, we must needs find a different way to do 
it if we don't want to deal with AM/PM. Fortunately, the dateItems time/date 
format gives you everything you need on a silver platter, or at least in a 
comma-delimited list whose individual parts you can access thru "item X of 
TheTime". To a second approximation:

function Sec2Standard DaSecs
   convert DaSecs from seconds to dateItems
   return item 4 of DaSecs & ":" & item 5 of DaSecs & ":" & item 6 of DaSecs
end Sec2Standard

   No AM/PM here, thanks. However, it's worth noting that dateItems believes 
in a 24-hour clock; if you send this function the number of seconds 
corresponding to "10:53:12 PM", it will spit out the result "22:53:12". Could this be 
a 
problem for what you're doing? I dunno, but fortunately, it's not difficult to 
translate a 24-hour *hour* into a 12-hour *hour*, you should pardon the 
expression. To a third approximation:

function Sec2Standard DaSecs
   convert DaSecs from seconds to dateItems
   # mind the line wrap here...
   return item 4 of DaSecs) - 1) mod 12) + 1) & ":" & item 5 of DaSecs & 
":" & item 6 of DaSecs
end Sec2Standard

   There: Whether the number of seconds you send this puppy corresponds to 
"10:53:12 PM" or "10:53:12", this function *will* give "10:53:12" right back to 
you.

   Hope this helps...
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: seconds to standard time numberformat?

2003-08-22 Thread Ken Ray
There isn't one (although having a "convert  to HMS" would be nice), but
you can do it by converting the seconds to dateItems, and then taking items
4 to 6 (which are the hours, minutes and seconds), and padding them with
zeroes if they are less than 10 and then finally concatenating them together
with ":"s.

Ken Ray
Sons of Thunder Software
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/


> From: Mark Swindell <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Fri, 22 Aug 2003 07:35:33 -0700
> To: [EMAIL PROTECTED]
> Subject: seconds to standard time numberformat?
> 
> Is there a numberformat or other option that will display seconds in
> standard 00:00:00 format?
> 
> I've got a "send to me in 1 second...add 1 to field theTime" scenario
> going on a project, and would like the result to display in standard
> form, rather than raw seconds.  What's the most efficient way to make
> this happen?
> 
> Thanks
> Mark
> 
> ___
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: seconds to standard time numberformat?

2003-08-22 Thread J. Landman Gay
On 8/22/03 9:35 AM, Mark Swindell wrote:

Is there a numberformat or other option that will display seconds in 
standard 00:00:00 format?
get the seconds
convert it to long time
put it
--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


seconds to standard time numberformat?

2003-08-22 Thread Mark Swindell
Is there a numberformat or other option that will display seconds in 
standard 00:00:00 format?

I've got a "send to me in 1 second...add 1 to field theTime" scenario 
going on a project, and would like the result to display in standard 
form, rather than raw seconds.  What's the most efficient way to make 
this happen?

Thanks
Mark
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: numberFormat prop

2002-07-10 Thread Dar Scott


On Tuesday, July 9, 2002, at 02:58 PM, [EMAIL PROTECTED] wrote:

> thats easy, fields do not have a numberFormat property.

Ah, but maybe you can make one!  And a number property, too, of 
course, to set and get the number.  Add a few more handlers for 
events to handle input and (tah-dah) a numeric field!

Dar Scott

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



RE: numberFormat prop

2002-07-10 Thread peter . fink


>
>Rob,
>
>>> Anybody know how to set the decimal precision of a numeric value? I
have
>>> looked through the docs but I can't seem to find the reference.
>> 
>> Hi Steve,
>> 
>> Did you check the numberFormat property?
>

thats easy, fields do not have a numberFormat property. It works as follows:
  set the numberFormat to "0.00"
  put (numeric expression) into fld "xy"

  set the numberFormat to "0.000"
  add 0 to fld "xy"

  set the numberFormat to "0."
  put fld "xy"+0 into fld "xy"

  set the numberFormat to "0.0"
  put (numeric expression) & "" into variable

true, at least it worked this way in Hypercard (see p. 442).
Peter






___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



numberFormat woes

2002-07-09 Thread Jan Schenkel

Steve Messimer and Sivakatirswami both had
questions/remarks regarding the numberFormat.

It wasn't always behaving properly for me either,
which is why I switched to using the 'format' command.
It's quite flexible indeed, though its C-inherited
syntax is a bit awkward at first.

I'm using that to put formatted data from cursors into
a list field, as RR has no tables -- and it works
great, so have a go at it :-)

Best regards,

Jan Schenkel.

"As we grow older, we grow both wiser and more foolish
at the same time."  (De Rochefoucald)

__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: numberFormat prop

2002-07-09 Thread Sarah

It is often necessary to do a fake calculation to force the numberFormat 
to be applied.
Try this script:

   put "123.56789" into theNum
   set the numberFormat to "#.00"
   answer theNum   -- gives 123.56789
   add 0 to theNum
   answer theNum   -- gives 123.57

You can't apply a numberFormat to a field but you can take the number 
out of the field, format it and put it back again, perhaps in a 
closeField handler.

Cheers,
Sarah

On Wednesday, July 10, 2002, at 06:42  AM, Steve Messimer wrote:

> Rob,
>
>>> Anybody know how to set the decimal precision of a numeric value? I 
>>> have
>>> looked through the docs but I can't seem to find the reference.
>>
>> Hi Steve,
>>
>> Did you check the numberFormat property?
>
> After thrashing around a bit I did find the numberFormat property on my 
> own.
> For some reason I was unable to get it to work correctly.  I think the 
> issue
> had to do with how and to what type of container it can be applied. I
> presumed that it can be applied to any container.
>
> I tried:
>
> set the numberFormat of fld "myFld" to "00.0" -- (and 00.0 and "##.#") 
> none
> of which worked
>
> then I tried:
>
> set the numberFormat of calcHolder to 00.0 -- where calcHolder is a var.
> (also tried 00.0 and "##.#") didn't work either
>
> Finally,  I just trunc'd the dang thing and I got pretty much what I was
> aiming for. I decided I really didn't need the decimal after all.
>
> put trunc(calcHolder * 100) into fld "myFld"
>
> That having been said it would be nice to see an example of how the
> numberFormat should work. :-)  Any examples will be much appreciated.
>
> Regards,
>
> Steve
>
> Stephen R. Messimer
> Messimer Computing, Inc
> 208 1st Ave South
> Escanaba, MI 49829
> www.messimercomputing.com
>
>
> ___
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution
>


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: numberFormat prop

2002-07-09 Thread Dar Scott


On Tuesday, July 9, 2002, at 02:48 PM, Scott Rossi wrote:

> Recently, "Steve Messimer"  wrote:
>
>> it would be nice to see an example of how the
>> numberFormat should work.
>
> I believe the numberFormat is a global property, not applied to 
> specific
> controls.  So you simply say "set the numberFormat to 0.00" and 
> then any
> scripts currently executing use this format.

It's local.

And be sure and read the paragraph marked "important" that explains 
that this applies only to numbers becoming strings, not to those 
just sitting there looking like numerals.  (Values can be character 
strings and--in a not-quite transparent way--numbers.)

Dar Scott

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: numberFormat prop

2002-07-09 Thread Scott Rossi

Recently, "Steve Messimer"  wrote:

> it would be nice to see an example of how the
> numberFormat should work.

I believe the numberFormat is a global property, not applied to specific
controls.  So you simply say "set the numberFormat to 0.00" and then any
scripts currently executing use this format.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-
E: [EMAIL PROTECTED]
W: http://www.tactilemedia.com

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



numberFormat prop

2002-07-09 Thread Steve Messimer

Rob,

>> Anybody know how to set the decimal precision of a numeric value? I have
>> looked through the docs but I can't seem to find the reference.
> 
> Hi Steve,
> 
> Did you check the numberFormat property?

After thrashing around a bit I did find the numberFormat property on my own.
For some reason I was unable to get it to work correctly.  I think the issue
had to do with how and to what type of container it can be applied. I
presumed that it can be applied to any container.

I tried:

set the numberFormat of fld "myFld" to "00.0" -- (and 00.0 and "##.#") none
of which worked

then I tried:

set the numberFormat of calcHolder to 00.0 -- where calcHolder is a var.
(also tried 00.0 and "##.#") didn't work either

Finally,  I just trunc'd the dang thing and I got pretty much what I was
aiming for. I decided I really didn't need the decimal after all.

put trunc(calcHolder * 100) into fld "myFld"

That having been said it would be nice to see an example of how the
numberFormat should work. :-)  Any examples will be much appreciated.

Regards,

Steve

Stephen R. Messimer
Messimer Computing, Inc
208 1st Ave South
Escanaba, MI 49829
www.messimercomputing.com


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution