Brian Dunning's FileMaker Custom Functions

ImportoInLettere ( importo )

Re-writes amounts in words in Italian language (1/3)

  Average rating: 4.3 (35 votes) Log in to vote

Federico Severin   Federico Severin
Sevesoftware Engineering
http://www.sevesoftware.it

Share on Facebook Share on Twitter

  Sample input:
ImportoInLettere ( 1237,24 )
  Sample output:
milleduecentotrentasette/24

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

// IMPORTANT: you need also ImportoInLettereRicorsiva

// Given a number - in format xxxxxxxxxx,yy - translate in letters the integer part xxxxxxxxxx and append /yy (in numbers) at the end
// This is the way amounts are re-written in Italy to spell the number and check the correctness.
// It exploits a recursive function, that provides the litteral translation of the integer part.
// The second parameter of ImportoInLettereRicorsiva, that indicates the position (and so the value) of digits, at the beginning is 0.

Dichiara (


[
parteIntera = Tronca ( importo ; 0 );
parteDecimale = ( Arrotonda ( importo ; 2 ) - parteIntera ) * 100
];

ImportoInLettereRicorsiva ( parteIntera ; 0 ) & "/" & Casi ( parteDecimale = 0 ; "00"; parteDecimale < 10 ; "0" & parteDecimale ; parteDecimale )

)

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.