|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Cdbl & International SettingsHi, I have a problem with two function: IsNumber() and CDbl() because when I
invoke it they throw an exception. The problem I think is International Settings, because NumberDecimalSeparator and NumberDecimalGroup have the same value "." I can't change this setting on computer by default so what I want to know if I can change this settings only for my application. I've used System.Globalization but CDbl use the settings in contro pannel. Thanks in advice Hello michelle,
Use system.globalization.cultureinfo.currentculture.numberformat.numberdecimalseparator and numbergroupseparator to indicate the separators you want. Instead of CDbl, use Double.Parse, which uses current thread culture information. Regards. Show quoteHide quote "michele" <michele.ze***@unipr.it> escribió en el mensaje news:%23NKUo0iLGHA.2124@TK2MSFTNGP14.phx.gbl... | Hi, I have a problem with two function: IsNumber() and CDbl() because when I | invoke it they throw an exception. | The problem I think is International Settings, because | NumberDecimalSeparator and NumberDecimalGroup have the same value "." | I can't change this setting on computer by default so what I want to know if | I can change this settings only for my application. | | I've used System.Globalization but CDbl use the settings in contro pannel. | | Thanks in advice Thank you, in fact I've used it and I thought that all was ok but I
discovered that I used I PrintDocument that involved "International Settings" and I've the applicationt runs ok but I can't print because I don't know how to set enviroment to PrintDocument. "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio Use news:uA%238kZlLGHA.3860@TK2MSFTNGP12.phx.gbl... Hello michelle, system.globalization.cultureinfo.currentculture.numberformat.numberdecimalseparator and numbergroupseparator to indicate the separators you want. Instead of CDbl, use Double.Parse, which uses current thread culture information. Regards. Show quoteHide quote "michele" <michele.ze***@unipr.it> escribió en el mensaje news:%23NKUo0iLGHA.2124@TK2MSFTNGP14.phx.gbl... | Hi, I have a problem with two function: IsNumber() and CDbl() because when I | invoke it they throw an exception. | The problem I think is International Settings, because | NumberDecimalSeparator and NumberDecimalGroup have the same value "." | I can't change this setting on computer by default so what I want to know if | I can change this settings only for my application. | | I've used System.Globalization but CDbl use the settings in contro pannel. | | Thanks in advice I don't understand the problem. The PrintPage event runs on the same thread on which you call PrintDocument.Print, so it uses the same environment.
Regards. Show quoteHide quote "michele" <mich***@zenna.it> escribió en el mensaje news:ORbPitmLGHA.3104@TK2MSFTNGP11.phx.gbl... | Thank you, in fact I've used it and I thought that all was ok but I | discovered that I used I PrintDocument that involved "International | Settings" and I've the applicationt runs ok but I can't print because I | don't know how to set enviroment to PrintDocument. | | "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio | news:uA%238kZlLGHA.3860@TK2MSFTNGP12.phx.gbl... | Hello michelle, | | Use | system.globalization.cultureinfo.currentculture.numberformat.numberdecimalseparator | and numbergroupseparator to indicate the separators you want. | Instead of CDbl, use Double.Parse, which uses current thread culture | information. | | Regards. | | | "michele" <michele.ze***@unipr.it> escribió en el mensaje | news:%23NKUo0iLGHA.2124@TK2MSFTNGP14.phx.gbl... || Hi, I have a problem with two function: IsNumber() and CDbl() because when | I || invoke it they throw an exception. || The problem I think is International Settings, because || NumberDecimalSeparator and NumberDecimalGroup have the same value "." || I can't change this setting on computer by default so what I want to know | if || I can change this settings only for my application. || || I've used System.Globalization but CDbl use the settings in contro pannel. || || Thanks in advice Ok, maybe I missunderstand how to program so can you explain more, it it is
possible. I've tried to use System.Globalization.Cultureinfo.Currentculture.Numberformat.NumberDecimalSeparator = "," but this property is red-only.. Thanks "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio I don't understand the problem. The PrintPage event runs on the same thread news:eQP5N4vLGHA.4064@TK2MSFTNGP10.phx.gbl... on which you call PrintDocument.Print, so it uses the same environment. Regards. "michele" <mich***@zenna.it> escribió en el mensaje system.globalization.cultureinfo.currentculture.numberformat.numberdecimalseparatornews:ORbPitmLGHA.3104@TK2MSFTNGP11.phx.gbl... | Thank you, in fact I've used it and I thought that all was ok but I | discovered that I used I PrintDocument that involved "International | Settings" and I've the applicationt runs ok but I can't print because I | don't know how to set enviroment to PrintDocument. | | "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio | news:uA%238kZlLGHA.3860@TK2MSFTNGP12.phx.gbl... | Hello michelle, | | Use | Show quoteHide quote | and numbergroupseparator to indicate the separators you want. | Instead of CDbl, use Double.Parse, which uses current thread culture | information. | | Regards. | | | "michele" <michele.ze***@unipr.it> escribió en el mensaje | news:%23NKUo0iLGHA.2124@TK2MSFTNGP14.phx.gbl... || Hi, I have a problem with two function: IsNumber() and CDbl() because when | I || invoke it they throw an exception. || The problem I think is International Settings, because || NumberDecimalSeparator and NumberDecimalGroup have the same value "." || I can't change this setting on computer by default so what I want to know | if || I can change this settings only for my application. || || I've used System.Globalization but CDbl use the settings in contro pannel. || || Thanks in advice Yes, michele, the CultureInfo returned by System.Globalization.Cultureinfo.Currentculture is read only. You must replace it. Look at this sample:
Sub Main() Dim s as String = System.Globalization.CultureInfo.CurrentCulture.Name Dim ci As New System.Globalization.CultureInfo(s, True) System.Threading.Thread.CurrentThread.CurrentCulture = ci ci.NumberFormat.NumberDecimalSeparator = "," Debug.WriteLine(Double.Parse("3,14") * 10) ci.NumberFormat.NumberDecimalSeparator = "·" 'Debug.WriteLine(Double.Parse("3,14") * 10) 'Error: "," is not part of a number. Debug.WriteLine(Double.Parse("3·14") * 10) End Sub Regards. Show quoteHide quote "michele" <mich***@zenna.it> escribió en el mensaje news:%23KIJLVyLGHA.2012@TK2MSFTNGP14.phx.gbl... | Ok, maybe I missunderstand how to program so can you explain more, it it is | possible. | I've tried to use | System.Globalization.Cultureinfo.Currentculture.Numberformat.NumberDecimalSeparator | = "," | but this property is red-only.. | | Thanks | | | "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio | news:eQP5N4vLGHA.4064@TK2MSFTNGP10.phx.gbl... | I don't understand the problem. The PrintPage event runs on the same thread | on which you call PrintDocument.Print, so it uses the same environment. | | Regards. | | | "michele" <mich***@zenna.it> escribió en el mensaje | news:ORbPitmLGHA.3104@TK2MSFTNGP11.phx.gbl... || Thank you, in fact I've used it and I thought that all was ok but I || discovered that I used I PrintDocument that involved "International || Settings" and I've the applicationt runs ok but I can't print because I || don't know how to set enviroment to PrintDocument. || || "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio || news:uA%238kZlLGHA.3860@TK2MSFTNGP12.phx.gbl... || Hello michelle, || || Use || | system.globalization.cultureinfo.currentculture.numberformat.numberdecimalseparator || and numbergroupseparator to indicate the separators you want. || Instead of CDbl, use Double.Parse, which uses current thread culture || information. || || Regards. || || || "michele" <michele.ze***@unipr.it> escribió en el mensaje || news:%23NKUo0iLGHA.2124@TK2MSFTNGP14.phx.gbl... ||| Hi, I have a problem with two function: IsNumber() and CDbl() because | when || I ||| invoke it they throw an exception. ||| The problem I think is International Settings, because ||| NumberDecimalSeparator and NumberDecimalGroup have the same value "." ||| I can't change this setting on computer by default so what I want to know || if ||| I can change this settings only for my application. ||| ||| I've used System.Globalization but CDbl use the settings in contro | pannel. ||| ||| Thanks in advice Thanks, I write my code with you suggestion and now I thinks that it works
fine but tomorrow I test my application and then I'll tell you if all run. Thank you again, sincerly Michele "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio Yes, michele, the CultureInfo returned by news:eoFTC08LGHA.3264@TK2MSFTNGP11.phx.gbl... System.Globalization.Cultureinfo.Currentculture is read only. You must replace it. Look at this sample: Sub Main() Dim s as String = System.Globalization.CultureInfo.CurrentCulture.Name Dim ci As New System.Globalization.CultureInfo(s, True) System.Threading.Thread.CurrentThread.CurrentCulture = ci ci.NumberFormat.NumberDecimalSeparator = "," Debug.WriteLine(Double.Parse("3,14") * 10) ci.NumberFormat.NumberDecimalSeparator = "·" 'Debug.WriteLine(Double.Parse("3,14") * 10) 'Error: "," is not part of a number. Debug.WriteLine(Double.Parse("3·14") * 10) End Sub Regards. "michele" <mich***@zenna.it> escribió en el mensaje System.Globalization.Cultureinfo.Currentculture.Numberformat.NumberDecimalSeparatornews:%23KIJLVyLGHA.2012@TK2MSFTNGP14.phx.gbl... | Ok, maybe I missunderstand how to program so can you explain more, it it is | possible. | I've tried to use | Show quoteHide quote | = "," system.globalization.cultureinfo.currentculture.numberformat.numberdecimalseparator| but this property is red-only.. | | Thanks | | | "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio | news:eQP5N4vLGHA.4064@TK2MSFTNGP10.phx.gbl... | I don't understand the problem. The PrintPage event runs on the same thread | on which you call PrintDocument.Print, so it uses the same environment. | | Regards. | | | "michele" <mich***@zenna.it> escribió en el mensaje | news:ORbPitmLGHA.3104@TK2MSFTNGP11.phx.gbl... || Thank you, in fact I've used it and I thought that all was ok but I || discovered that I used I PrintDocument that involved "International || Settings" and I've the applicationt runs ok but I can't print because I || don't know how to set enviroment to PrintDocument. || || "José Manuel Agüero" <chema012 en hotmail.com> ha scritto nel messaggio || news:uA%238kZlLGHA.3860@TK2MSFTNGP12.phx.gbl... || Hello michelle, || || Use || | Show quoteHide quote || and numbergroupseparator to indicate the separators you want. || Instead of CDbl, use Double.Parse, which uses current thread culture || information. || || Regards. || || || "michele" <michele.ze***@unipr.it> escribió en el mensaje || news:%23NKUo0iLGHA.2124@TK2MSFTNGP14.phx.gbl... ||| Hi, I have a problem with two function: IsNumber() and CDbl() because | when || I ||| invoke it they throw an exception. ||| The problem I think is International Settings, because ||| NumberDecimalSeparator and NumberDecimalGroup have the same value "." ||| I can't change this setting on computer by default so what I want to know || if ||| I can change this settings only for my application. ||| ||| I've used System.Globalization but CDbl use the settings in contro | pannel. ||| ||| Thanks in advice
master volume control in winmm using namespaces
can you add onMouseOver/onMouseOut to an ImageButton?? Eschewing the Form Designer VB.NET (2005); Sqlce ? How to get worksheet names from an excel file? Is Office required on End user's PC ? VB.Net code to upsize Access DB to SQL Express? Hex with leading zeros to string? Dynamically remove child controls ? Step by step it works but... |
|||||||||||||||||||||||