sezercan19 Posted July 14, 2010 Share Posted July 14, 2010 I need convert int to word any one can help me please ? Link to comment Share on other sites More sharing options...
GEOSoft Posted July 14, 2010 Share Posted July 14, 2010 I started to write a function for that at one time and never did complete it. Pretty simple up to the thousands. There are several javascript versions of it available by usinggoogle. just search for it and then convert that code to AutoIt. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
trancexx Posted July 14, 2010 Share Posted July 14, 2010 This is confusing. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Yashied Posted July 14, 2010 Share Posted July 14, 2010 Maybe INT to DWORD? Within the limits of AutoIt. Number('0x' & Hex($Int)) My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
sezercan19 Posted July 14, 2010 Author Share Posted July 14, 2010 Maybe INT to DWORD? Within the limits of AutoIt. Number('0x' & Hex($Int)) i need Int To Word like in vb6 WordFromInterger Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2010 Developers Share Posted July 14, 2010 i need Int To Wordlike in vb6 WordFromIntergershow an example scriptlet where this is needed so we can understand. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
sezercan19 Posted July 14, 2010 Author Share Posted July 14, 2010 e.g vb6 code WordFromInterger("1") Link to comment Share on other sites More sharing options...
trancexx Posted July 14, 2010 Share Posted July 14, 2010 e.g vb6 codeWordFromInterger("1")And the result of that is? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
sezercan19 Posted July 14, 2010 Author Share Posted July 14, 2010 (edited) And the result of that is?returns 0100e.g 2WordfromInterger("12") returns 0C00 Edited July 14, 2010 by sezercan19 Link to comment Share on other sites More sharing options...
Developers Jos Posted July 14, 2010 Developers Share Posted July 14, 2010 Again, show a portion of a script that shows how you need to use it. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GEOSoft Posted July 14, 2010 Share Posted July 14, 2010 I think he wants a numerical to return the string representation. 100 returns "one hundred", 10 returns "ten" etc. I was writing an app for printing cheques when I last played with that. He knows the VBS function for it but js has no such function. That's why I suggested he look up the js code snippets that are all over the place and do a conversion. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Mat Posted July 14, 2010 Share Posted July 14, 2010 (edited) Probably slightly out... Uses short scale only as it's easy. expandcollapse popupLocal $iNum = 123456789876543 MsgBox(0, $iNum, NumToWord($iNum)) Func NumToWord($iNum) Local $asDigits[10] = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] Local $asTeens[8] = ["eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "nineteen"] Local $asTens[9] = ["ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] Local $asBig[22] = ["thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion", "septillion", "octillion", "nonillion", _ "decillion", "undecillion", "duodecillion", "tredecillion", "quattuordecillion", "quindecillion", "sexdecillion", "septendecillion", "octodecillion", "novemdecillion", "vigintillion"] Local $sRet = "" ; Very big numbers For $i = 22 To 1 Step - 1 If $iNum >= 10 ^ ($i * 3) Then $iTemp = Floor($iNum / (10 ^ ($i * 3))) $iNum -= $iTemp * (10 ^ ($i * 3)) $sRet &= NumToWord($iTemp) & " " & $asBig[$i - 1] & " " EndIf Next ; hundreds If $iNum >= 100 Then $iTemp = Floor($iNum / 100) $iNum -= $iTemp * 100 $sRet &= NumToWord($iTemp) & " hundred and " EndIf If $iNum > 10 And $iNum < 20 Then $iTemp = Floor($iNum - 11) $iNum -= 11 + $iTemp $sRet &= $asTeens[$iTemp] & " " Else ; Tens If $iNum >= 10 Then $iTemp = Floor($iNum / 10) $iNum -= $iTemp * 10 $sRet &= $asTens[$iTemp - 1] & " " EndIf ; Digits If $iNum >= 1 Then $sRet &= $asDigits[Floor($iNum)] & " " $iNum -= Floor($iNum) EndIf EndIf Return $sRet EndFunc Edited July 14, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
sezercan19 Posted July 14, 2010 Author Share Posted July 14, 2010 word = 2 byte Link to comment Share on other sites More sharing options...
Yashied Posted July 14, 2010 Share Posted July 14, 2010 word = 2 byte You do not say so. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
sezercan19 Posted July 14, 2010 Author Share Posted July 14, 2010 i solved this with my udf here is code Func WordFromInteger($data) $WordFromInteger = Hex($data) If StringLen($WordFromInteger) = 1 Then $WordFromInteger = "0" & $WordFromInteger & "00" ElseIf StringLen($WordFromInteger) = 2 Then $WordFromInteger = $WordFromInteger & "00" ElseIf StringLen($WordFromInteger) = 3 Then $WordFromInteger = StringMid($WordFromInteger, 2, 2) & "0" & StringLeft($WordFromInteger, 1) ElseIf StringLen($WordFromInteger) = 4 Then $WordFromInteger = StringMid($WordFromInteger, 3, 2) & StringLeft($WordFromInteger, 2) EndIf Return $WordFromInteger EndFunc Link to comment Share on other sites More sharing options...
Yashied Posted July 14, 2010 Share Posted July 14, 2010 (edited) i solved this with my udf here is code Func WordFromInteger($data) $WordFromInteger = Hex($data) If StringLen($WordFromInteger) = 1 Then $WordFromInteger = "0" & $WordFromInteger & "00" ElseIf StringLen($WordFromInteger) = 2 Then $WordFromInteger = $WordFromInteger & "00" ElseIf StringLen($WordFromInteger) = 3 Then $WordFromInteger = StringMid($WordFromInteger, 2, 2) & "0" & StringLeft($WordFromInteger, 1) ElseIf StringLen($WordFromInteger) = 4 Then $WordFromInteger = StringMid($WordFromInteger, 3, 2) & StringLeft($WordFromInteger, 2) EndIf Return $WordFromInteger EndFunc Congratulation, awesome UDF! Edited July 14, 2010 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Mat Posted July 14, 2010 Share Posted July 14, 2010 (edited) And there I was writing a big UDF to turn numbers into english words... Func WordFromInteger($data) Return Hex($data, 8) EndFuncAnd heres my updated NumToWord. It now works well and does decimals.linkYou will here a lot of people on the next page complaining at how the function that was until just now posted here didn't work and I admit I left out a possibly important number by mistake. The one there works. Edited September 17, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
MvGulik Posted July 15, 2010 Share Posted July 15, 2010 (edited) For those that like to extend NumToWord($iNum) to include "long scale" output.http://en.wikipedia.org/wiki/Names_of_large_numbers#Extensions_of_the_standard_dictionary_numbers(Org Example topic: NumToWord As in 100 = One hundred... *human* words...) Edited July 15, 2010 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Mat Posted July 15, 2010 Share Posted July 15, 2010 Short scale is a lot easier, and is the standard now. Thanks for advertising AutoIt Project Listing Link to comment Share on other sites More sharing options...
JoHanatCent Posted September 17, 2010 Share Posted September 17, 2010 Short scale is a lot easier, and is the standard now. Thanks for advertising OddIf I try this with "Local $iNum = 18"I get NineTeen ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now