George John has Published 1234 Articles

How to format number to 2 decimal places in MySQL?

George John

George John

Updated on 19-Mar-2023 12:06:46

3K+ Views

You can use TRUNCATE() function from MySQL to format number to 2 decimal places. The syntax is as follows −SELECT TRUNCATE(yourColumnName, 2) as anyVariableName from yourTableName;To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table FormatNumberTwoDecimalPlace   ... Read More

What is Java String literal?

George John

George John

Updated on 05-Sep-2022 11:34:39

3K+ Views

Strings, which are widely used in Java programming, are a sequence of characters. In Java programming language, strings are treated as objects. The Java platform provides the String class to create and manipulate strings. You can also create a String directly as − String greeting = "Hello world!"; A ... Read More

C++ Program to Compute the Area of a Triangle Using Determinants

George John

George John

Updated on 04-Jul-2020 14:33:05

431 Views

In this section we will see how to find the area of a triangle in 2D coordinate space using matrix determinants. In this case we are considering the space is 2D. So we are putting each points in the matrix. Putting x values at the first column, y into the ... Read More

Define colors using the Red-Green-Blue-Alpha model (RGBA) with CSS

George John

George John

Updated on 04-Jul-2020 06:59:05

151 Views

Use the CSS rgb() function to define color using the RGB Model.Use the CSS rgba() function to set RGB colors with opacity.ExampleYou can try to run the following code to set the color with rgba() functionLive Demo                    h1 { ... Read More

Usage of CSS grid property

George John

George John

Updated on 04-Jul-2020 06:43:52

145 Views

Set the following properties with the grid property: grid-template-rows, grid-template-columns, grid-template-areas, grid-auto-rows, grid-auto-columns, and grid-auto-flow property.ExampleYou can try to run the following code to implement the CSS grid propertyLive Demo                    .container {             display: ... Read More

Define the height of each row in CSS Grid Container

George John

George John

Updated on 04-Jul-2020 06:35:02

82 Views

Use the grid-template-rows property to define the number of rows in CSS Grid Layout.ExampleYou can try to run the following code to set a number of rows.Live Demo                    .container {             display: grid;   ... Read More

Role of CSS flex-direction property row-reverse value

George John

George John

Updated on 04-Jul-2020 06:17:28

109 Views

Use the flex-direction property with row value to set the flex-items horizontally, from right to left.ExampleYou can try to run the following code to implement the row-reverse value −Live Demo                    .mycontainer {             display: flex; ... Read More

How to play ringtone/alarm/notification sound in Android?

George John

George John

Updated on 03-Jul-2020 08:02:25

3K+ Views

This example demonstrate about How to play ringtone/alarm/notification sound in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 − ... Read More

Role of CSS justify-content property flex-start value

George John

George John

Updated on 03-Jul-2020 07:52:50

97 Views

Use the justify-content property with value flex-start to align the flex-items at the beginning.ExampleYou can try to run the following code to implement the flex-start value −Live Demo                    .mycontainer {             display: flex;       ... Read More

Usage of transform-origin property with CSS

George John

George John

Updated on 02-Jul-2020 08:04:18

116 Views

Use the transform-origin property to change the position on transformed elements with CSS.ExampleYou can try to run the following code to learn how to work with transform-origin property with CSSLive Demo                    .demo1 {             ... Read More

Advertisements