Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi all,
i tried to convert amount in words as Indian currency but in case of amount is in lacs
or above conversion is not properly.
 
My formula in CR is:
 
1.
 
formula= Towords(truncate(890010.89), 0) + " and " + towords(abs(100 * (truncate(890010.89)- 890010.89)), 0) + " centavos";
 

2.
 
local stringvar sNumber := cstr(Sum (890010.89));
local numbervar whole := truncate(Sum (890010.89));
local numbervar pos := instrrev(sNumber, '.');
local numbervar decimal := 0;
 
if pos > 0 then
(
decimal := CDbl(right(sNumber, length(sNumber) - pos));
);
 
Uppercase(ToWords(whole, 0) + ' Rupee(s) and ' + ToWords(decimal, 0) + ' Paise Only');
 

Note: Above formulas working properly upon thousands but for thousands above not working...
 
Please help me for proper conversion either in terms of lacs or above..
Posted 28-Feb-12 19:27pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 235
1 Sergey Alexandrovich Kryukov 120
2 Richard MacCutchan 100
3 ChauhanAjay 95
4 BotCar 95
0 Sergey Alexandrovich Kryukov 9,056
1 OriginalGriff 8,041
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 29 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100