CAST equalizes how to define AND convert data into results.
The specification of nummber of places overall and number of decimal places works with the examples you give, but for example this leads to a N(18,3) field, while I'd want to have a N/7,3) field:
Code:
Create Cursor initial (num float)
Insert Into initial Values (1.123)
Select 001.000*num from initial Into cursor test
Afields(laFields)
? Textmerge("<<laFields[1,2]>>(<<laFields[1,3]>>,<<laFields[1,4]>>)")
I think you will argue then don't do such things, only use a numeric literal as you suggest and don't combine defining field with also populating them in the query. Well, you can do that, but then have postprocessing work to make use of the defined fields. That's also true when you first CREATE CURSOR, as I suggested, too.
But with CAST you can have full control, it is obvious even just reading the source dode what field types you get also when you use CAST as casting and converting mechanism in one go.
By teh way, the N(18,3) I get as result is not even what I would expected from the way VFP deermines the length and precision of a numeric result in general. When you multiply numbers, as in theory you can get to twice the number of decimal places to store the result precisely, think of 0.01*0.01 being 0.0001, so 4 decimal places necessary from multiplying two numbers with each 2 decimal places.
You don't need to make acrobatic neuroligical stunts to know you get a N(3,1) field from 0.0 or up to 9.9, but if you not just use the mechanism to define an unpopulated new field but also populate it with the result you eventually want to store it, CAST is the option giving you much better control and documents it, too.
And one further argument is that CAST is standard, you'll fail with something like SELECT 0.00 in any database but VFP.
And there are more field type than char and numeric. You don't create a varchar field without CAST, for example.