w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Proper number format not coming for spanish
You have to set NSNumberFormatterCurrencyStyle instead of NSNumberFormatterDecimalStyle and CurrencySymbol to Empty to remove the symbol of Currency. Working Code : NSNumberFormatter *currencyFormatter = [[NSNumberFormatter alloc] init]; [currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; [currencyFormatter setCurrencySymbol:@""]; [currencyFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"]]; NSLog(@"Final Value :: %@", [currencyFormatter stringFromNumber:[NSNumber numberWithFloat:1000000]]); Output (As you want without Currency Symbol) : Final Value :: 1.000.000,00

Categories : Iphone

spanish characters not coming properly in javascript?
I guess your HTML or JS file or both of them are not saved as UTF-8. You should adjust your editor's charset settings. Depending on the editor you might find them in the save dialog or the files' properties.

Categories : Javascript

css - Divs not coming in a proper way
Your item holds the sub-item. The problem is that item has a fixed height of 35px. sub-item has a top-margin of 40px. This means that the distance from the top of item to the top of sub-item is 40 px -- which is larger than the whole size of item itself! To solve, remove the height: 35px from .item in your CSS. See this updated JSFiddle.

Categories : HTML

Convert a "big" Hex number (string format) to a decimal number (string format) without BigInteger Class
An easy way would be to use a big number library that supports your version of .NET. I'd recommend GnuMpDotNet, which uses the excellent GMP library. By default it targets .NET 3.5, but you can change that to .NET 2.0 without breaking anything (just remove the references and using statement that refer to new things), as it doesn't use anything from .NET 3.5. Here is an example using GnuMpDotNet: BigInt e = new BigInt(hexString, 16); string decimalStr = e.ToString();

Categories : C#

DateTime is not in proper format
There's several ways to do this. Either: Change the regional settings for the user running your web application Use the correct CultureInfo object when formatting Set the default CultureInfo object on the current thread Escape the slashes To provide a CultureInfo object when formatting: @Html.DisplayFor(modelItem => item.EndDate.ToString("dd/MM/yyyy", CultureInfo.GetCulture("en-US"))) To set the default CultureInfo object: Thread.CurrentThread.CurrentCulture = CultureInfo.GetCulture("en-US"); To escape the slashes, use single quotes: [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd'/'MM'/'yyyy}")] Note that all the code ends up in DateTime.ToString(string) or one of its overloads, so that's the place to look for clues to this.

Categories : C#

Convert into proper XML format
Add a reference to System.Web and use the HttpServerUtility.UrlDecode Method (String): var decodedXml = System.Web.HttpUtility.UrlDecode(xml);

Categories : C#

Itextsharp Next line in paragraph coming right below serial number
Rather adding your list items to paragraph, create List items of itextsharp and add it to Arraylist of listItem. You can create Ordered and Unorder list item, similar to HTML counterpart <ul> and <ol> Check below code: iTextSharp.text.List list = new iTextSharp.text.List(iTextSharp.text.List.ORDERED, 20f); list.IndentationLeft = 20f;//indented 20 points from left margin list.Add("The RomanList is added to the ordered list, and iTextSharp indents the RomanList relative to the ordered list to which it belongs"); list.Add("The RomanList is added to the ordered list, and iTextSharp indents the RomanList relative to the ordered list to which it belongs"); list.Add("Three"); pdfDoc.Add(list);//add list to document Above code will create ordered list. Second argument s

Categories : Asp Net

how to get proper dropdown format for dates
The POSTed information is the value of the option, not its text. If you want the text, you can: echo "<option value=".$month_array[$i]." name='Resolved_date2'>".$month_array[$i]."</option>"; To limit the number of days according to the chosen month, you'll have to do it on the client side, using javascript or preferably one of its frameworks like jQuery.

Categories : PHP

jsp not passing UTF-8 data in proper format
The character encoding specified in the page (or in the web.xml) is applied to the following phases of an HTTP communication: Preparing / sending the Request from the Client to the Server Receiving / reading the Request in the Server Preparing / sending the Response from the Server to the Client Receiving / reading the Response in the Client The Application Server is the only responsible for the phase 2. You need to look for your specific application server settings, to alter the default character encoding (that could easily be ISO-8859-1), and alter it to work in UTF-8. For example, in Tomcat you would need to edit the conf/server.xml file, by adding the URIEncoding="UTF-8" parameter to the <Connector>, for example from <Connector port="8090" /> to <Connector p

Categories : Java

What's the proper format for a union initializer list?
A union holds only one member at a time, so you initialize it with only one value. You may use Box iMyBoxA = { value }; to initialize the first-listed member of the union or Box iMyBoxA = { .name = value }; to initialize a particular member by name. Some notes: Your code is missing a semicolon after the union declaration; it should be: struct Box { union { AS128 intr; AS32 a, b, c, d; }; }; Since you have a union inside a struct, you ought to use two sets of braces for the initializers: Box iMyBoxA = { { value } }; The syntax with one set of braces is permitted but may elicit warnings from your compiler. Designated initializers (member names in initializers) are a C 1999 feature. This question is tagged with C and C++. A C++ compiler might or might not accept a designated initial

Categories : C++

How to convert currency from string format to number format?
You can make switch cases according to your denominations. By choosing particular switch case you can choose the desired value. I don't think there is predefined method to accomplish this. hope this helps.

Categories : Iphone

Get proper format of the text file in HTML form
If I get it right, you should replace your new line characters with <br> or <p>. Try str = [str stringByReplacingOccurrencesOfString:@" " withString:@"<br>"]; How to detect new lines in Objective-C Solution of your next question might look like this: NSArray *words = [str componentsSeparatedByString:@" "]; NSString *line = @""; NSUInteger maxLineLength = 100; NSString *resultStr = @""; for (NSString *word in words) { if ([line length] + [word length] > maxLineLength) { resultStr = [resultStr stringByAppendingFormat:@"%@<br>", line]; line = word; } else { line = [line stringByAppendingFormat:@" %@", word]; } } resultStr = [resultStr stringByAppendingString:line];

Categories : HTML

C - What is the proper format to allow a function to show an error was encountered?
There is not really a standard practice for this kind of error handling in C. But a good handling in your specific case would be returning NaN, in other words 0.0/0.0. /* error else */ else { etc(); return 0.0/0.0; } Which would yield NaN. You can check if a value is not a number by comparing it with itself, as NaN is the only float/double value that will fail when comparing to itself. yvalue = getYValueAt(...) if (yvalue != yvalue) { treat_error_here(); } This is just an option, there are other ways of handling this kinds of error.

Categories : C

how can i get array in proper format from this foreach and nested if condition in php?
Update to this one. From : array_push($color1,$color); $items = array($color1); To array_push($color1, $color); if(!empty($color1)) { $items[] = $color1; } And $items = array() before loop.

Categories : PHP

How to place content in proper table format in repeater?
Ignoring the fact that this piece of HTML is totally invalid (ul -> li -> div -> a -> table), try to set the cell vertical alignment to top (<td valign="top">). A good advice. Try to use CSS and rewrite this using just divs and make it valid. <ul> <li> <div class="product"> <a href="#" class="info"> <table class="holder"> <asp:Repeater ID="repContent" runat="server"> <ItemTemplate> <%# (Container.ItemIndex + 4) % 4 == 0 ? "<tr>" : string.Empty %> <td valign="top"> <img src='<%#"/productimages/main/" + Eval("PhotoName").ToString().Trim

Categories : Asp Net

Laravel4: check if the inserted email is in a proper format
Just define a custom error message: $messages = array( 'email' => 'Address in mailbox given :attribute does not comply with RFC 2822, 3.6.2.', ); $validator = Validator::make($input, $rules, $messages);

Categories : Forms

How to format number in mootools number.format()
It is group not groups. console.log( (123456789).format({ group: " " }) ); JSFiddle

Categories : Javascript

Primefaces p:calendar and format user input into proper date
it's true that's too late but may be cold help someone else . you can't use Mask but you can do it with regex expression for exemple : <p:calendar value="#{MyBean.MyDate}" id="MyCalendar" effect="explode" > <f:validateRegex pattern="^(?:(?:31(/|-|.)(?:0?[13578]|1[02]))1|(?:(?:29|30)(/|-|.)(?:0?[1,3-9]|1[0-2])2))(?:(?:1[6-9]|[2-9]d)?d{2})$|^(?:29(/|-|.)0?23(?:(?:(?:1[6-9]|[2-9]d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1d|2[0-8])(/|-|.)(?:(?:0?[1-9])|(?:1[0-2]))4(?:(?:1[6-9]|[2-9]d)?d{2})$"> <p:ajax update="msgMyCalendar" event="keyup" /> </f:validateRegex> </p:calendar> <p:message for="MyCalendar" id="msgMyCalendar" display="icon"/>

Categories : Jquery

Format a number based on a required number of decimal places *and* sig figs
Look at accepted answer for this question. I've ported code from the accepted answer to C# and made some tests. Code: using System; using System.Diagnostics; using System.Linq; namespace ConsoleApplication1 { public static class NumericExtensions { public static double RoundToSignificantFigures(this double num, int n) { if (num == 0) { return 0; } double magnitude = Math.Pow(10, n - (int)Math.Ceiling(Math.Log10(Math.Abs(num)))); double shifted = Math.Round(num * magnitude); return shifted / magnitude; } public static double RoundToSignificantFiguresWithConvert(this double num, int n) { var sigFigFormatted = num.ToString("G" + n.ToString())

Categories : C#

number format exception with phone number input string
first try with following thing way.. long phn = Integer.parseInt("12312312"); and also note this .... ps.setString(4, mail); ps.setString(5, addr); ps.setString(7,uid); It should be " ps.setString(6,uid);".

Categories : String

How to get current date and time and save it into char* array in proper format?
You can use strftime function: http://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html strftime is described in C99 Standard in 7.23.3.5.

Categories : C

jQuery datepicker changing format dosent show proper month
If you only need to month and year (since thats what you are storing on the input) you can use this: $(function() { //set datepicker or month/year selection $('#a').datepicker( { changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'MM yy' }); $("#a").focus(function () { $(".ui-datepicker-calendar").hide(); //add event to perform on done button click $(".ui-datepicker-close").click(function(){ var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); $("#a").datepicker('option', 'defaultDate', new Date(year, month, 1));

Categories : Javascript

Format a number as phone number in MS Ajax
I don't know C#, this is how you can do picture formatting in javascript: format = "(###)###-####" input = 1234567890 formatted = format.replace(/#/g, [].shift.bind(String(input).split(""))) // result: "(123)456-7890" To handle strings shorter than a picture, try this slightly more verbose code: chars = String(input).split("") formatted = format.replace(/#/g, function() { return chars.shift() || "" })

Categories : Javascript

python time conversion into proper time format
Instead of using time.strptime, which returns a time tuple, you could use datetime.strptime, which returns a datetime object: import datetime as DT thetime = '2013-07-16T16:14:34+0000' finaltime = DT.datetime.strptime(thetime, "%Y-%m-%dT%H:%M:%S+0000").strftime('%B %d, %Y %I:%M %p') print(finaltime) yields July 16, 2013 04:14 PM With Python2.7.5 or better, you can also use the %z directive to parse the UTC offset instead of using the fixed string +0000: DT.datetime.strptime(thetime, "%Y-%m-%dT%H:%M:%S%z")

Categories : Python

Making and distributing iOS App in Spanish
Provide only an espanol strings file. Just like you've written English only apps until now, you can make this one espanol only. Take a look at https://developer.apple.com/internationalization/ and follow the practices so that you can add other languages in the future.

Categories : IOS

Query regarding date which is in Spanish
You need to remove "del" from the date then use DateTime.Parse. DateTime.Parse("Viernes, 19 de Abril 2013", new CultureInfo("es-ES")) returns 4/19/2013.

Categories : Vb.Net

C++ spanish question mark
this character is simply not included in basic ascii. Try using wstring http://www.cplusplus.com/reference/string/wstring/

Categories : C++

Format-number from ###.0 to ###.00
This may be due to undeclared namespace in your XSLT. Please check whether namespaces are declared correctly in your XSLT. Unless you show the full XSLT coding with XML coding, we cannot able to provide solution. However please refer the below Sample XML and XSLT with the output XSLT: <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="chapter"> <Value> <xsl:variable name="num" select="number"/> <xsl:value-of select="format-number($num,'00.00')"/> </Value> </xsl:template> </xsl:stylesheet> Sample XML <?xml version="1.0"?> <chapter> <number>45</number> </chapter> Output <?xml version='1.0' ?> <Value>45.00</V

Categories : Xslt

Allow alphanumeric with spanish regex in javascript?
if(/^[0-9a-zñáéíóúü]+$/i.test(string)) { alert("oK WITH THE INPUT"); } else { alert("error"); } Make the regex match more than one character with the + quantifier Make it match the entire input with ^ and $ anchors Don't negate the character class (remove the ^)

Categories : Javascript

How to send email with Spanish characters
If you take a look at the MailMessage.BodyEncoding property, you'll note the following: The default character set is "us-ascii". Try changing your encoding before sending: message.BodyEncoding = Encoding.UTF8; (I'm assuming you're sending using a System.Net.Mail.MailMessage. If you're using System.Net.Mail.SmtpClient directly, I would recommend switching to using the MailMessage class and passing instances of that to your SmtpClient.)

Categories : C#

How to provide a Spanish translation of my website?
Specifically to answer your question on loading and unloading JavaScript files, there is a brilliant response already on StackOverflow: Best way to load and unload JS file via JQuery by Chris Pratt But fundimentially you can't unload a JS once it's been loaded. Maybe what you should look at is implementing language configuration on the server end, so when outputting the HTML it looks at a language file. If you are using PHP+Smarty for example it is made very easy.

Categories : Javascript

How to get the best number format string?
In your case it does not matter, because you are using int. This format #,## and #,# are for doubles and means that print only two digits after decimal point

Categories : C#

Number format in Oracle SQL
NUMBER(p,s) p(precision) = length of the number in digits s(scale) = places after the decimal point So Number(8,2) in your example is a '999999.99' You can see more examples here.

Categories : SQL

Extjs tpl for number format
ExtJS tpl allow for easy formatting using methods from the Ext.util.Format class, which can be implemented with the following syntax: <p>Number: {myDataNumber:number( "0.00" )}</p> Of course, you can specify whatever format you need for the number formatting. Also, if none of the built in format functions work, you could always add to Ext.util.Format (it's a singleton) or specify a custom member function (see Ext.XTemplate docs) for the specific template. Either way, you can implement any format you could imagine...just depends on what the best way is based on your requirements.

Categories : Extjs

PHP number format without comma
number_format() takes additional parameters: number_format(1000.5, 2, '.', ''); The default is a period (.) for the decimal separator and a comma (,) for the thousands separator. I'd encourage you to read the documentation.

Categories : PHP

Format number in SQL Server
just divide your number by 100 you will get result. update yourtable set B=B/100 or it seeems like your B variable is varchar you can try this. set @B=convert(varchar,cast(@B as decimal) / 100);

Categories : Sql Server

p:inputtext format number like '999,999'
You need to test the whole value on the client side. I've made a fiddle with example JS validation: http://jsfiddle.net/lechlukasz/w8K8j/1/ It calls validation function on blur: function valid(val) { var reg = new RegExp('^[0-9]{1,3}(,[0-9]{1,3})?$'); if (!reg.test(val)) return false; return true; } If you want to make full validation on keypress, don't forget to allow the coma as the last character (illegal in final string, but necessary when typing :)

Categories : Javascript

Number Format For Datagridview in C#
Goto your Form's Design mode then goto the properties of dgvmain there check DefaultCellStyle and set the format as you like. OR you can do this dgvmain.Columns["Amount"].DefaultCellStyle.Format = "N2"; :)

Categories : C#

CSS or PHP add space in number format
You can use preg_replace $str = '+4420719480'; echo preg_replace('~^.{3}|.{4}(?!$)~', '$0 ', $str); pattern explanation: ~ # pattern delimiter ^.{3} # any character 3 times at the start of the string | # OR .{4} # any character 4 times (?!$) # not followed by the end of the string ~ # pattern delimiter replacement: '$0 ' (the whole pattern and a space)

Categories : PHP

angularjs search and ignore spanish characters
JavaScript has a neat function for this, called localeCompare, where you can specify sensitivity = base, an option that makes it treat á and a as equivalent, but it is not widely supported. I think your only option is to create a filter function wherein you normalise both strings manually (replacing ó with o and so on) and compare the results.

Categories : Angularjs



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.